next up previous
Next: The Shell Interface Up: Interactive Interfaces Previous: Interactive Interfaces

The MATLAB Interface

 

Within MATLAB, NetSolve may be used in two ways. It is possible to call NetSolve in a blocking or nonblocking fashion. Here is an example of the MATLAB interface to solve an linear system computation using the blocking call:

       >> a = rand(100); b = rand(100,1);
       >> x = netsolve('ax=b',a,b)

This MATLAB script first creates a random matrix, a, and a vector b of length 100. The call to the netsolve function returns with the solution This call manages all the NetSolve protocol, and the computation may be executed on a remote host.

Here is the same computation performed in a nonblocking fashion:

       >> a = rand(100); b = rand(100,1);
       >> request = netsolve_nb('send','ax=b',a,b)
       >> x = netsolve_nb('probe',request)
            Not Ready Yet
       >> x = netsolve_nb('wait',request)

Here, the first call to netsolve_nb() sends a request to the NetSolve agent and returns immediately with a request identifier. One can then either probe for the request or wait for it. This approach allows user-level parallelism and communication/computation overlapping (see Section 7).

Other functions are provided, for example, to obtain informations on the problems available or on the status of the pending requests.



Joint Institute for Computational Science
Mon Apr 29 13:00:40 EDT 1996