CloudEvaluate[expr]
evaluates expr in the cloud and returns the result.
CloudEvaluate[expr,h]
wraps the head h around the result before returning it.
CloudEvaluate
CloudEvaluate[expr]
evaluates expr in the cloud and returns the result.
CloudEvaluate[expr,h]
wraps the head h around the result before returning it.
Details and Options
- CloudEvaluate has attribute HoldFirst.
- CloudEvaluate[expr] automatically includes all definitions needed to evaluate expr, much like CloudSave.
- CloudEvaluate has the following option:
-
CloudBase Automatic what cloud to do the evaluation in IncludeDefinitions True whether to automatically include dependencies - With IncludeDefinitionsTrue, definitions required for the evaluation of expr will automatically be sent to the cloud through CloudEvaluate.
- With IncludeDefinitions->False, definitions required for the evaluation of expr must be loaded and evaluated explicitly during the evaluation of expr.
Examples
open all close allBasic Examples (3)
Search for Mersenne primes in the cloud:
CloudEvaluate[Table[If[MersennePrimeExponentQ[i], i, Nothing], {i, 1000}]]Evaluate machine-specific settings in the cloud:
CloudEvaluate[{$OperatingSystem, $MachineID}]{$OperatingSystem, $MachineID}Supply a head to be applied to the results of a cloud evaluation:
CloudEvaluate[Fibonacci[100], f]Scope (1)
Create a 3D contour plot in the cloud:
CloudEvaluate[ContourPlot3D[x ^ 3 + y ^ 2 - z ^ 2 == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]]Use the cloud to identify the content of an image:
CloudEvaluate[ImageIdentify[[image]]]Use the cloud to do image analysis:
CloudEvaluate[
painting = Entity["Artwork", "NightWatch::Rembrandt"]["Image"];
<|painting -> DominantColors[painting]|>
]Generalizations & Extensions (1)
Options (2)
CloudBase (1)
Evaluate on a specific cloud without changing $CloudBase:
CloudEvaluate[$MachineName, CloudBase -> "https://www.epc.example.com"]IncludeDefinitions (1)
By default, local function and other symbol definitions are included with the expression evaluated in the cloud:
count = 99;
f[x_] := x + 1
CloudEvaluate[f[count], Hold]Do not include local definitions:
count = 99;
f[x_] := x + 1
CloudEvaluate[f[count], Hold, IncludeDefinitions -> False]Properties & Relations (3)
CloudEvaluate shows any messages raised during the evaluation:
CloudEvaluate[1 / 0]However, any other notebook manipulations, such as printed output, are not reproduced:
CloudEvaluate[Print["text"]]In a cloud evaluation, $CloudEvaluation is set to True:
CloudEvaluate[$CloudEvaluation]Individual cloud evaluations typically run in separate processes:
{CloudEvaluate[$ProcessID], CloudEvaluate[$ProcessID]}Using CloudEvaluate during a cloud evaluation always runs in the same process:
CloudEvaluate[{$ProcessID, CloudEvaluate[$ProcessID]}]Possible Issues (3)
The result of the cloud evaluation is subject to evaluation in the local session. Multiple evaluations can result in multiple messages:
CloudEvaluate[Plot[]]Apply the head Hold to prevent the second, local evaluation:
CloudEvaluate[Plot[], Hold]With the default setting of IncludeDefinitionsTrue, the local definition of a symbol occurring in the expression is included, even if it is not used.
Set a symbol to a large expression:
ByteCount[data = ByteArray[RandomInteger[{0, 255}, 10 * 2 ^ 20]]]A CloudEvaluate that references a symbol that is set in the local kernel session may take longer than expected because the definition is transmitted to the cloud:
AbsoluteTiming[
CloudEvaluate[
incomingSize = ByteCount[data];data = ByteArray[RandomInteger[{0, 255}, 10000]]; {incomingSize, ByteCount[data]}
]
]Use IncludeDefinitionsFalse to avoid including local definitions:
AbsoluteTiming[
CloudEvaluate[
incomingSize = ByteCount[data];data = ByteArray[RandomInteger[{0, 255}, 10000]]; {incomingSize, ByteCount[data]},
IncludeDefinitions -> False
]
]Cloud evaluations have restrictions on memory usage and evaluation time. The limitations for CloudEvaluate are determined by your cloud plan, and the specific amounts can be found in CloudAccountData as the "DeployedMemoryLimit" and "DeployedEvaluationTimeLimit":
CloudAccountData /@ {"DeployedMemoryLimit", "DeployedEvaluationTimeLimit"}Related Guides
Text
Wolfram Research (2014), CloudEvaluate, Wolfram Language function, https://reference.wolfram.com/language/ref/CloudEvaluate.html (updated 2019).
CMS
Wolfram Language. 2014. "CloudEvaluate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/CloudEvaluate.html.
APA
Wolfram Language. (2014). CloudEvaluate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CloudEvaluate.html
BibTeX
@misc{reference.wolfram_2026_cloudevaluate, author="Wolfram Research", title="{CloudEvaluate}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/CloudEvaluate.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_cloudevaluate, organization={Wolfram Research}, title={CloudEvaluate}, year={2019}, url={https://reference.wolfram.com/language/ref/CloudEvaluate.html}, note=[Accessed: 13-June-2026]}