2
$\begingroup$

Parallelize in Mathematica is pretty easy to use. Most of the time, applying Parallelize to an expression, it tries to evaluates expr using automatic parallelization. Is there an option that Parallelize as a default behavior in evaluation? or there is some special reason that using Parallelize as the default evaluation is not a good idea?

Following are some related questions for the possible reasons why Parallelize should not be the default evaluation method:

  1. Parallelize does not speed up execution all the time:

Why won't Parallelize speed up my code?

  1. Only a few functions are Parallelize-able

List of Parallelize[]-able functions

  1. And several bugs in the function

Why is this parallel evaluation with Dispatch[] so slow?

Why doesn't ParallelTable work on this very simple example?

$\endgroup$
  • 3
    $\begingroup$ "or there is some special reason that using Parallelize as the default evaluation is not a good idea?" <-- Yes; 1. Sometimes it's more harmful than helpful and will slow down things 2. Some things cannot be parallelized and this cannot be easily autodetected. Think functions with sideeffects. It's better to have manual control over this. $\endgroup$ – Szabolcs Jun 19 '15 at 13:26
  • $\begingroup$ @Szabolcs is it a good idea to make a list of function, when an expression contains those function, then apply Parallelize automatically? $\endgroup$ – Kattern Jun 19 '15 at 13:28
  • 3
    $\begingroup$ I think this is a problem that has been worked on for a long time, and no doubt still being worked on. Mathematica already automatically parallelizes some computations (e.g., via MKL). If one observes processor activity, one can see it being used occasionally with NIntegrate, Reduce, etc., although that usually indicates it's time for another coffee or to answer email. Other relevant Q&A: mathematica.stackexchange.com/q/35271, mathematica.stackexchange.com/q/84380, mathematica.stackexchange.com/q/3407, mathematica.stackexchange.com/a/39405. $\endgroup$ – Michael E2 Jun 19 '15 at 13:51
  • $\begingroup$ @MichaelE2 so the short answer is maybe in the future version. $\endgroup$ – Kattern Jun 19 '15 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.