Skip to content

Joblib.Parallel hangs when passed an empty iterable (python 2.7) #292

Description

@joshloyal

Currently the parallel loop will hang for the following code snippets

from math import sqrt
from joblib import Parallel, delayed

Parallel(n_jobs=2)(delayed(sqrt)(i) for i in range(0))

or even just

Parallel(n_jobs=2)([])

I'm not too familiar with the internals of the parallel loop, but it seems to be because we are requesting a parallel loop with an empty iterable (it works fine for n_jobs=1, i.e. a flat loop). Up until joblib==0.9.2 this would return an empty list.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions