Wolfram Compute Services Batch Computation
| Setting Up a Batch Job | Using Paclets and Resources in a Batch Job |
| Notifications | Parallel Computation |
| Batch Job Options | Incremental Output |
Wolfram Compute Services provides a way to submit batch jobs using cloud compute resources.
| RemoteBatchSubmit[expr] | submit a batch job |
| job["JobStatus"] | enquire about a batch job's status |
| job["EvaluationResult"] | obtain a job's result |
Submitting batch jobs and obtaining their status and results.
A batch job is submitted and then runs unattended. You can check its progress repeatedly and be notified when it completes. Once complete, you can obtain its result. Batch jobs are ideal for long-running jobs and for jobs that require large compute resources.
Setting Up a Batch Job
Typically, you may want to develop your code using a small example, then submit a larger example as a batch job.
Once the code seems to be working, you can submit a larger instance. Definitions, such as for findMersennePrime, that you make in your session will be distributed automatically to the batch job, which is a completely separate Wolfram session. Only in this way will the batch job know what to do with findMersennePrime.
Notifications
By default, a batch job will send two email messages to the address, which is your $WolframID. One message is sent when the job begins running, another one when it completes.
The message sent when the job completes successfully will contain a piece of code you can evaluate to retrieve the job's result. This code works in any Wolfram session; you do not need to keep the session in which you submitted the job active.
Given the job's UUID, you can retrieve the job object in a new session and continue to work with it.
Notifications can be customized with an option setting in RemoteBatchSubmit.
| None | do not send any notifications |
| JobCompleted | send a single message when the job completes |
| {"Email","SMS"} | send notifications both by email and SMS |
| {"JobCreditsUsed",n} | send notifications every time n more credits are spent |
Common settings for the RemoteJobNotifications option.
Batch Job Options
Job Limits
You can limit a job's maximal runtime, or maximal cost, expressed in Service Credits. A job that does not succeed before a limit is reached will be aborted, returning a "Terminated" failure status.
Choosing Compute Resources
The default available remote machine class, "Basic1x8", is the most cost effective and provides one CPU and a limited amount of memory. It is ideal for development and smaller tasks that do not benefit form parallelism.
At the highest end, "Compute192x384" provides 192 CPUs and 384GB of memory.
Parallel Computation
You can choose to run a job on a remote machine with many processors and run a parallel computation. Parallel kernels will be launched automatically.
Incremental Output
A remote batch job that terminates abnormally will not return a result. For long-running search jobs that return only a few results, it may make sense to capture the results as they are found, while the job is still running.
You can use a cloud object to accumulate the results as they are found.
In the search job, each result is appended to the cloud object as it is found, and regular progress is printed to the log file. The job is set up without an upper limit on the search range, running until it is terminated either when it reaches a limit or when it is aborted.
The credit limit safeguards against spending too many credits, and regular notifications about credits spent provide feedback: