next up previous contents index
Next: Checking interpreter status Up: Top-level Commands Previous: Configurations and remote execution

Background execution


NESL allows background execution of expressions. This is most useful when evaluating expressions that might take a long time to complete. It is also useful on supercomputers that allow more machine resources (memory, processors, runtime) to be used for batch jobs than for interactive jobs.

name &= exp [,mem := n] [,max_time := n] [,config := config]; 
This evaluate the expression exp in the background and assigns the result to the background variable name. The NESL prompt returns soon as the job has been submitted. For example:

<Nesl> a &= sum([0:100000]);

[1] 12782
background a : int
The result is retrieved using the get command described below. The &= command has three optional arguments:

get name;  
This is used to retrieve a background variable. If the job is not completed, the message ``Variable waiting for result'' will be printed. If the job is completed, all output generated during execution will be printed, and if there was no error the result will be assigned to the variable name. The status of background jobs can be examined with the show status command described below.

Guy Blelloch
Tue Nov 28 18:37:09 EST 1995