ParallelCases
✖
ParallelCases
gives a list of all parts of expr on levels specified by levelspec that match the pattern.
Details and Options


- ParallelCases is a parallel version of Cases.
- ParallelCases will give the same results as Cases, except for side effects during the computation.
- Parallelize[Cases[data,pattern]] is equivalent to ParallelCases[data,pattern].
- The following options can be given:
-
Method Automatic granularity of parallelization DistributedContexts $DistributedContexts contexts used to distribute symbols to parallel computations ProgressReporting $ProgressReporting whether to report the progress of the computation - The Method option specifies the parallelization method to use. Possible settings include:
-
"CoarsestGrained" break the computation into as many pieces as there are available kernels "FinestGrained" break the computation into the smallest possible subunits "EvaluationsPerKernel"->e break the computation into at most e pieces per kernel "ItemsPerEvaluation"->m break the computation into evaluations of at most m subunits each Automatic compromise between overhead and load balancing - Method->"CoarsestGrained" is suitable for computations involving many subunits, all of which take the same amount of time. It minimizes overhead but does not provide any load balancing.
- Method->"FinestGrained" is suitable for computations involving few subunits whose evaluations take different amounts of time. It leads to higher overhead but maximizes load balancing.
- The DistributedContexts option specifies which symbols appearing in expr have their definitions automatically distributed to all available kernels before the computation.
- The default value is DistributedContexts:>$DistributedContexts with $DistributedContexts:=$Context, which distributes definitions of all symbols in the current context but does not distribute definitions of symbols from packages.
- The ProgressReporting option specifies whether to report the progress of the parallel computation.
- The default value is ProgressReporting:>$ProgressReporting.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (1)Survey of the scope of standard use cases
Options (5)Common values & functionality for each option
DistributedContexts (2)
By default, definitions in the current context are distributed automatically:

https://wolfram.com/xid/05fj27besy-rq4d10

https://wolfram.com/xid/05fj27besy-jtb7ne

Do not distribute any definitions of functions:

https://wolfram.com/xid/05fj27besy-nlglup

https://wolfram.com/xid/05fj27besy-byauou

Method (1)
ProgressReporting (2)
Do not show a temporary progress report:

https://wolfram.com/xid/05fj27besy-08hwk6

Use Method"FinestGrained" for the most accurate progress report:

https://wolfram.com/xid/05fj27besy-mjasgf

![]() |
Properties & Relations (1)Properties of the function, and connections to other functions
Parallelize[Cases[…]] is equivalent to ParallelCases[…]:

https://wolfram.com/xid/05fj27besy-xp298k


https://wolfram.com/xid/05fj27besy-b4orea

Possible Issues (1)Common pitfalls and unexpected behavior
The optional length argument of Cases cannot be parallelized:

https://wolfram.com/xid/05fj27besy-6nsdbu


Wolfram Research (2025), ParallelCases, Wolfram Language function, https://reference.wolfram.com/language/ref/ParallelCases.html.
Text
Wolfram Research (2025), ParallelCases, Wolfram Language function, https://reference.wolfram.com/language/ref/ParallelCases.html.
Wolfram Research (2025), ParallelCases, Wolfram Language function, https://reference.wolfram.com/language/ref/ParallelCases.html.
CMS
Wolfram Language. 2025. "ParallelCases." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ParallelCases.html.
Wolfram Language. 2025. "ParallelCases." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ParallelCases.html.
APA
Wolfram Language. (2025). ParallelCases. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ParallelCases.html
Wolfram Language. (2025). ParallelCases. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ParallelCases.html
BibTeX
@misc{reference.wolfram_2025_parallelcases, author="Wolfram Research", title="{ParallelCases}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ParallelCases.html}", note=[Accessed: 16-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_parallelcases, organization={Wolfram Research}, title={ParallelCases}, year={2025}, url={https://reference.wolfram.com/language/ref/ParallelCases.html}, note=[Accessed: 16-April-2025
]}