title: Stuck parallelisation with sklearn with large number of features (n_jobs=-1)
body: <p>When trying to run a simple <code>GridSearchCV</code> with <code>n_job=-1</code> often results in stuck processing. For example, </p>
  
  <pre><code>&gt;&gt; parameters_SGD = {'clf__l1_ratio': np.linspace(0,1,30), 'clf__alpha': np.logspace(-5,-1,5), 'clf__penalty':['elasticnet'], 'clf__class_weight': [None, 'balanced'],'clf__loss':['log','hinge']}
  &gt;&gt; pipe_SGD = Pipeline([('scl', StandardScaler()),('clf', linear_model.SGDClassifier())])
  &gt;&gt; grid_search_SGD = GridSearchCV(estimator=pipe_SGD, param_grid=parameters_SGD, verbose=1, scoring=make_scorer(f1_score, average='weighted', pos_label=1), n_jobs = -1)
  </code></pre>
  
  <p>executing on some data (X_train, y_train):</p>
  
  <pre><code>&gt;&gt; grid_search_SGD.fit(X_train, y_train)
  </code></pre>
  
  <p>may result in frozen computations -> CPU usage drops to 1-3% and nothing happens.</p>
  
  <p><strong>When it happens:</strong> if the number of features of <code>X</code> is (relatively) large (>100). The CPU usage climbs up to 99% (which means all cores work) and then suddenly drops down to 1-3%.</p>
  
  <p>If I use only small subset of features (randomly selected), then parallelisation works perfectly (99-100% of CPU and I can see jobs done in parallel).</p>
  
  <p><strong>Does anyone have any idea why it happens?</strong> What may cause parallel jobs to be stuck?</p>
  
  <p>(sklearn v 0.18, mac osx)</p>