gridsolve_nb.m

Go to the documentation of this file.
00001 function [varargout] = gridsolve_nb(varargin)
00002 % sessionid = gridsolve_nb('send', 'service', inputargs)
00003 % status = gridsolve_nb('probe', sessionid)
00004 % status = gridsolve_nb('cancel', sessionid)
00005 % [outputargs, ...] = gridsolve_nb('wait', sessionid)
00006 % 
00007 % Asynchronous, non-blocking call to the GridSolve network solver.
00008 % Returns a sessionid which can be used by other calls to check on the
00009 % service.  Use gs_info('service') to see the the arguments for the
00010 % service.
00011 %
00012 % See also gs_wait, gs_probe, gs_cancel for details on probing,
00013 % waiting, canceling.
00014 
00015 mexindex = 0;
00016 if (nargin < 2)
00017   fprintf('Error: Insufficient parameters\n');
00018 else
00019   if (strcmp(varargin{1},'send')==1) 
00020     mexindex = 2;
00021   elseif (strcmp(varargin{1},'wait')==1) 
00022     mexindex = 3;
00023   elseif (strcmp(varargin{1},'probe')==1) 
00024     mexindex = 6;
00025   elseif (strcmp(varargin{1},'cancel')==1) 
00026     mexindex = 7;
00027   end
00028 end
00029   
00030 if (nargout > 0) 
00031   for i=1:nargout, varargout{i} = []; end
00032   [varargout{:}] = matlab_gs_lib(mexindex, varargin{2:size(varargin,2)});
00033 else 
00034   matlab_gs_lib(mexindex, varargin{2:size(varargin,2)});
00035 end