0001 function dkepath = update_remote_jd(dkepath,link_mode,test_mode,display_mode)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 if nargin < 4,
0017 display_mode = 1;
0018 end
0019
0020 lukever = LUKEversion_jd;
0021 lukever(lukever == ' ' | lukever == '.') = '_';
0022
0023
0024
0025 lochostname = hostname_jd;
0026
0027
0028
0029 nrem = 0;
0030 flag_local = [];
0031
0032 for irem = 1:length(dkepath.remote),
0033 if isfield(dkepath.remote(irem),'remoteid'),
0034 remotestr = ['remote_',dkepath.remote(irem).remoteid];
0035 if exist([remotestr,'.m'],'file'),
0036
0037 nrem = nrem+1;
0038 remote(nrem) = feval(remotestr,dkepath.remote(irem).schedulername,dkepath.remote(irem).profilename);
0039 remote(nrem).env.luke_root = dkepath.remote(irem).luke_root;
0040 if isfield(dkepath.remote(nrem),'link_mode'),
0041 remote(nrem).link_mode = dkepath.remote(irem).link_mode;
0042 end
0043 if isfield(dkepath.remote(nrem),'cvsupdate'),
0044 remote(nrem).cvsupdate = dkepath.remote(irem).cvsupdate;
0045 end
0046 if isfield(dkepath.remote(nrem),'cvsrights'),
0047 remote(nrem).cvsrights = dkepath.remote(irem).cvsrights;
0048 end
0049 if isfield(dkepath.remote(nrem),'gitupdate'),
0050 remote(nrem).gitupdate = dkepath.remote(irem).gitupdate;
0051 end
0052 if isfield(dkepath.remote(nrem),'gitmode'),
0053 remote(nrem).gitmode = dkepath.remote(irem).gitmode;
0054 end
0055
0056
0057 else
0058 continue
0059 end
0060 else
0061
0062 nrem = nrem+1;
0063 remote(nrem) = dkepath.remote(nrem);
0064
0065 end
0066
0067 if any(strfind(lochostname,remote(nrem).hostname)),
0068 remote(nrem).host = '';
0069 flag_local(nrem) = true;
0070 else
0071 flag_local(nrem) = false;
0072 end
0073 end
0074
0075 if ~isempty(link_mode) && link_mode == -1,
0076 remote = remote(find(flag_local));
0077 nrem = length(remote);
0078 link_mode = [];
0079 end
0080
0081 if nrem == 0,
0082 remote = [];
0083 end
0084
0085
0086
0087
0088 flag = true(1,nrem);
0089
0090 for irem = 1:nrem
0091
0092
0093
0094 if isfield(remote(irem).env,'luke_root'),
0095
0096 if isstruct(remote(irem).env.luke_root),
0097
0098 if isfield(remote(irem).env.luke_root,lukever),
0099 remote(irem).env.luke_root = remote(irem).env.luke_root.(lukever);
0100 elseif isfield(remote(irem).env.luke_root,'LUKE_default') && ~isempty(remote(irem).env.luke_root.LUKE_default),
0101 remote(irem).env.luke_root = remote(irem).env.luke_root.LUKE_default;
0102 else
0103 flag(irem) = false;
0104 info_dke_yp(6,['no compatible LUKE version found for remote profile #',num2str(irem),' to host : ',remote(irem).host,'. Profile disabled.'])
0105 end
0106 end
0107 else
0108 flag(irem) = false;
0109 end
0110 end
0111
0112
0113
0114 if isempty(link_mode) || isnan(link_mode) || link_mode >= 0,
0115
0116 if test_mode,
0117 disp (' ')
0118 info_dke_yp(3,'Testing remote profile connections ')
0119 end
0120
0121 [dkepath.remote,dkepath.profilestr] = load_remoteprofiles_jd(remote(flag),test_mode,false,NaN,NaN,false,false,link_mode);
0122
0123 nrem = length(dkepath.remote);
0124
0125 if display_mode == 1,
0126 dispremoteprofiles(dkepath);
0127 else
0128 disp (' ')
0129 info_dke_yp(2,'To list available remote profiles type ''dispremoteprofiles;''')
0130 end
0131
0132 else
0133
0134 dkepath.remote = [];
0135 dkepath.profilestr = {};
0136 nrem = 0;
0137
0138 end
0139
0140 dkepath.remprofiles = cell(1,1 + nrem);
0141 dkepath.distprofiles = cell(1,3 + nrem);
0142
0143 dkepath.remprofiles{1} = 'Local interactive calculation';
0144
0145 dkepath.distprofiles{1} = 'Sequential';
0146 dkepath.distprofiles{2} = 'MDCE Job scheduler';
0147 dkepath.distprofiles{3} = 'MDCE parfor';
0148
0149 for irem = 1:nrem,
0150 dkepath.remprofiles{irem+1} = dkepath.profilestr{irem};
0151 dkepath.distprofiles{irem+3} = ['batch jobs on ',dkepath.profilestr{irem}];
0152 end
0153
0154
0155
0156