Nonblocking Call

We developed this nonblocking call for the same reason we developed one for Matlab (see the section called Calling netsolve_nb() in Chapter 6): to allow the user to have some NetSolve-parallelism. The nonblocking version of netsl() is netslnb(). Similarly, the nonblocking version of FNETSL() is FNETSLNB(). The user calls it exactly as he would call netsl() or FNETSL(). If the call to netslnb() or FNETSLNB() is successful, it returns a request handler in the form of a (positive) integer. If it is not successful, it returns an error code. Continuing with our example:
 CALL FNETSLNB( 'DGESV()', REQUEST, N, 1, A, LDA, IPIV,
&               B, LDB, INFO )
and in C :
request = netslnb('dgesv()',n,1,a,max,ipiv,b,max,&info);

In case of an error, the request handler actually contains the (negative) NetSolve error code.

The next step is to check the status of the request. As in the Matlab interface, the user can choose to probe or to wait for the request. Probing is done by calling netslpr() or FNETSLPR() which returns a NetSolve error code:
CALL FNETSLPR( REQUEST, INFO )
and in C :
info = netslpr(request);

Typical error codes returned are NetSolveNotReady and NetSolveOK (see Chapter 24). Waiting is done by using netslwt() or FNETSLWT(). This function blocks until the computation is complete and the result is available. Here is the Fortran77 call:
CALL FNETSLWT( REQUEST, INFO )
and the C call :
info = netslwt(request);
If the call is successful, the function/subroutine returns the error code NetSolveOK and the result is in the user memory space.