dclukecomputing

PURPOSE ^

LUKE - LUKE distributed computing environment

SYNOPSIS ^

function [flag,varargout] = dclukecomputing(fun_handle,args_in,arg_index,arg_range,scheduler)

DESCRIPTION ^

 LUKE - LUKE distributed computing environment

   Distributed computing using the LUKE distributed computing environment

   INPUT:

       - fun_handle: function handle
       - args_in: input arguments list of the function {1,nargin}
       - arg_index: index in the argument list args_in which must be changed [1,1]
       - arg_range: list of values for the input argument arg_index [1,nrange]
           => nrange = length(arg_range) = number of jobs 
       - scheduler: scheduler information

   OUTPUT:

       - flag: status of the computation : scheduler.mode (OK with dclukecomputing) or -2 (failed) [1,nrange]
       - varargout: output arguments list of the function {1,nargout-1}.
           => Each element is a list of size {nrange,1}

   by Y. Peysson (CEA/DSM/IRFM) (yves.peysson@cea.fr) and J. Decker (CEA/DSM/IRFM) (joan.decker@cea.fr)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [flag,varargout] = dclukecomputing(fun_handle,args_in,arg_index,arg_range,scheduler)
0002 % LUKE - LUKE distributed computing environment
0003 %
0004 %   Distributed computing using the LUKE distributed computing environment
0005 %
0006 %   INPUT:
0007 %
0008 %       - fun_handle: function handle
0009 %       - args_in: input arguments list of the function {1,nargin}
0010 %       - arg_index: index in the argument list args_in which must be changed [1,1]
0011 %       - arg_range: list of values for the input argument arg_index [1,nrange]
0012 %           => nrange = length(arg_range) = number of jobs
0013 %       - scheduler: scheduler information
0014 %
0015 %   OUTPUT:
0016 %
0017 %       - flag: status of the computation : scheduler.mode (OK with dclukecomputing) or -2 (failed) [1,nrange]
0018 %       - varargout: output arguments list of the function {1,nargout-1}.
0019 %           => Each element is a list of size {nrange,1}
0020 %
0021 %   by Y. Peysson (CEA/DSM/IRFM) (yves.peysson@cea.fr) and J. Decker (CEA/DSM/IRFM) (joan.decker@cea.fr)
0022 %
0023 nrange = length(arg_range);
0024 varargout_array = cell(nrange,nargout-1);
0025 flag = scheduler.mode*ones(1,nrange);
0026 %
0027 id = NaN(1,nrange);
0028 %
0029 try
0030     %
0031     dcluke(scheduler,0,'RESET');%initialisation
0032     %
0033     for j_range = 1:nrange,
0034         args_in{arg_index} = arg_range{j_range};
0035         id(j_range) = dcluke(scheduler,func2str(fun_handle),args_in{:});%submit jobs
0036     end
0037     %
0038     dcluke(scheduler);%wait for job completion
0039     %
0040     for j_range = 1:nrange,
0041         %
0042         try
0043             [varargout_array{j_range,:}] = dcluke(scheduler,id(j_range));
0044         catch me_load
0045             disp(['Error loading the results for run ',int2str(j_range),'/',int2str(nrange),' : flagged for sequential run']);
0046             disp(['===> Error : ',getReport(me_load)]);
0047             flag(j_range) = -2;
0048         end
0049         %
0050     end
0051     %
0052 catch me_dcluke
0053     disp('Error running dclukecomputing : flagged for sequential run');
0054     disp(['===> Error : ',getReport(me_dcluke)]);
0055     flag = -2*ones(1,nrange);
0056 end
0057 %
0058 varargout = cell(1,nargout-1);
0059 %
0060 %[varargout{:}] = deal(cell(N_range,1)); keep this line as an example of use of the function deal
0061 %
0062 for j_argout = 1:nargout-1,
0063     %
0064     varargout{j_argout} = varargout_array(:,j_argout);
0065     %
0066 end
0067 %

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.