We developed a MATLAB interface which provides interactive access to the NetSolve system. Interactive interfaces offer several advantages. First, they are easy to use because they completely free the user from any code writing. Second, the user still can exploit the power of software libraries. Third, they provide good performance by capitalizing on standard tools such as MATLAB. Let us assume, for instance, that MATLAB is installed on one machine on the local network. It is possible to use NetSolve via the MATLAB interface on this machine and in fact use the computational power of another more powerful machine where MATLAB is not available.
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. Probing always returns immediately, either signaling that the result is not available yet or, if available, stores the result in the user data space. Waiting blocks until the result is available and then store it in the user data space. This approach allows user-level parallelism and communication/computation overlapping (see Section 2.4).
Other functions are provided, for example, to obtain information on the problems available or on the status of pending requests.