Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute in parallel the generalized outer product of lists
ResourceFunction["ParallelOuter"][f,list1,list2,…] generates a nested list. The mapped list associated with list1 is outermost. | |
ResourceFunction["ParallelOuter"][f] represents an operator form of ResourceFunction["ParallelOuter"] that can be applied to a sequence of expressions. |
ParallelOuter gives the same output as Outer, but evaluated in parallel:
In[1]:= |
Out[1]= |
In the classical parallel implementation, this computation is blocked by one of the sublists taking substantially longer than the others:
In[2]:= |
Out[2]= |
ParallelOuter distributes the computation more evenly across kernels:
In[3]:= |
Out[3]= |
ParallelOuter reproduces the nesting structure of ParallelTable:
In[4]:= |
Out[4]= |
Use a different mapping function:
In[5]:= |
In[6]:= |
Out[6]= |
In[7]:= |
Out[7]= |
Pass in options specific to the mapping function:
In[8]:= |
In[9]:= |
Out[9]= |
ParallelOuter differs from Outer in the interpretation of its arguments:
In[10]:= |
Out[10]= |
In this way, ParallelOuter can be used like Map or Table:
In[11]:= |
Out[11]= |
ParallelOuter treats as separate elements only sublists at level 1 in the lists:
In[12]:= |
Out[12]= |
Use Parallelize to obtain a speedup while using Outer, albeit with the same limitation as ParallelTable (namely, that the parallelization occurs at the first level only):
In[13]:= |
Out[13]= |
This work is licensed under a Creative Commons Attribution 4.0 International License