19

This time I have a very short question.

Is there a deeper reason why ParallelMapThread does not exist?

Regards, Frink

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
RMMA
  • 2,710
  • 2
  • 18
  • 33

2 Answers2

17

Many functional operations including MapThread can be easily parallelized by composing the function with ParallelSubmit, then collecting all concurrent jobs:

WaitAll[MapThread[ParallelSubmit @* f, {{a1, a2, a3}, {b1, b2, b3}}]]
J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Roman
  • 516
  • 4
  • 4
16

May be because its easy to implement?

MapThread[f, {{a1, a2, a3}, {b1, b2, b3}}]

(* {f(a1,b1),f(a2,b2),f(a3,b3)} *)

ParallelMap[f @@ # &, {{a1, a2, a3}, {b1, b2, b3}} // Transpose]

(* {f(a1,b1),f(a2,b2),f(a3,b3)} *)

chris
  • 22,860
  • 5
  • 60
  • 149