0001 function flag = check_remote_yp(dkepath,remlist,debugmode,link_mode,log_mode)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 if nargin < 5,
0036 log_mode = 1;
0037 end
0038 if nargin < 4,
0039 link_mode = NaN;
0040 end
0041 if nargin < 3,
0042 debugmode = 0;
0043 end
0044 if nargin < 2,
0045 remlist = NaN;
0046 end
0047 if nargin < 1,
0048 dkepath = '';
0049 end
0050
0051 if ~isempty(link_mode) && ~isnan(link_mode),
0052 link_modestr = ['_link_mode_',num2str(link_mode)];
0053 else
0054 link_modestr = '';
0055 end
0056
0057 filename = '';
0058
0059 if log_mode,
0060
0061 filename = ['res_check_remote_yp_',datestr(now,29),link_modestr,'.log'];
0062
0063 if input_dke_yp(['Do you want to save the results in the log file ',filename,' ? (y/n)'],'n',{'y','n'}) == 'y',
0064
0065 if exist(filename,'file'),
0066 delete(filename);
0067 end
0068
0069 diary(filename);
0070
0071 end
0072
0073 end
0074
0075 if ~isempty(remlist) && ~isnan(sum(remlist)) && ~isempty(dkepath),
0076
0077 dkepath.remote = dkepath.remote(remlist);
0078 dkepath.profilestr = dkepath.profilestr(remlist);
0079 dkepath.remprofiles = dkepath.remprofiles([1,remlist+1]);
0080 dkepath.distprofiles = dkepath.distprofiles([1:3,remlist+3]);
0081
0082 remlist = 1:length(remlist);
0083
0084 dkepath = setpath_luke_jd(dkepath,link_mode);
0085
0086 else
0087 dkepath = setpath_luke_jd(dkepath,link_mode,0);
0088 end
0089
0090
0091
0092 disp(' ')
0093 info_dke_yp(2,'Testing remote connection for dkepath.remote profiles using LUKE code.');
0094
0095 nrem = length(dkepath.remote);
0096
0097 flag = zeros(1,nrem);
0098
0099 if nargin < 4 || isempty(remlist),
0100 remlist = input_dke_yp('Please identify profiles to be tested.',1:nrem,[1;nrem]);
0101 elseif isnan(remlist),
0102 remlist = 1:nrem;
0103 end
0104
0105 for irem = remlist,
0106
0107 disp(' ')
0108 disp('-----------------------------------------------------')
0109 disp(' ')
0110 info_dke_yp(2,['Testing profile : ',dkepath.profilestr{irem}]);
0111
0112 job = matstandardjob_jd('runmat');
0113 job.debugmode = debugmode;
0114 job.remtimout = 5;
0115
0116 job.funcopy = 0;
0117
0118 flag_remote_path = 0;
0119 disp(' - LUKEversion_jd.m on the remote machine is used');
0120 [err,~,remotelukever,~,remotematrel] = matremote_jd('LUKEversion_jd',{},dkepath.remote(irem),job);
0121
0122 if ~isempty(err),
0123 disp('----------------------------')
0124 disperr_jd(err);
0125 disp('----------------------------')
0126
0127 disp(' - LUKEversion_jd.m send from the local machine to the remote one is used.');
0128 job.funcopy = 1;
0129 [err,~,remotelukever,~,remotematrel] = matremote_jd('LUKEversion_jd',{},dkepath.remote(irem),job);
0130 flag_remote_path = 1;
0131 end
0132
0133 disp(' ')
0134 if isempty(err),
0135 info_dke_yp(4,['Version ',remotelukever,' with Matlab ',remotematrel,' working.'])
0136 flag(irem) = 1;
0137 if flag_remote_path, flag(irem) = -1; end
0138 else
0139 disperr_jd(err);
0140 end
0141
0142 end
0143
0144 disp(' ')
0145
0146 if ~isempty(filename),
0147 diary('off');
0148 end
0149