0001 function [ydate,yout1,yout2,yout3,yout4,yout5]= remote_tsbase(shotnumber,signal,remote_enforce,cluster)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 if nargin < 2,
0025 error('Not enough input argument in remote_tsbase.m');
0026 end
0027 if nargin < 3
0028 remote_enforce = 0;
0029 cluster = 'ANDROMEDE';
0030 end
0031 if nargin < 4
0032 cluster = 'ANDROMEDE';
0033 end
0034
0035 remote_profile_ANDROMEDE = remote_CEA_ANDROMEDE;
0036 remote_profile_SIRRAH = remote_CEA_SIRRAH;
0037
0038 if remote_enforce == 0,
0039 [err_ANDROMEDE,txt_ANDROMEDE] = unix(['ssh -Y ',remote_profile_ANDROMEDE.remoteuser,'@',remote_profile_ANDROMEDE.host,' "hostname"']);
0040 [err_SIRRAH,txt_SIRRAH] = unix(['ssh -Y ',remote_profile_SIRRAH.remoteuser,'@',remote_profile_SIRRAH.host,' "hostname"']);
0041 err = err_ANDROMEDE + err_SIRRAH;
0042
0043 if err == 0,
0044 txt = txt_SIRRAH;
0045 else
0046 if err_ANDROMEDE == 0,
0047 txt = txt_ANDROMEDE;
0048 else
0049 txt = '';
0050 end
0051 end
0052 else
0053 err = 0;
0054 err_ANDROMEDE = '';
0055 err_SIRRAH = '';
0056 txt = '';
0057 end
0058
0059
0060
0061 ydate = [];
0062 yout1 = [];
0063 yout2 = [];
0064 yout3 = [];
0065 yout4 = [];
0066 yout5 = [];
0067
0068 [err_local,txt_local] = unix('hostname');
0069
0070 if strcmp(txt_local,txt),
0071 remote_enforce = 0;
0072 end
0073
0074 if err==0,
0075
0076 if ~isempty(txt) && remote_enforce == 0,
0077 [yout1,yout2,yout3,yout4,yout5] = tsbase(shotnumber,signal);
0078 [ydate] = tsdate(shotnumber);
0079 err = '';
0080 job = '';
0081 else
0082 dkepath = load_structures_yp('dkepath','','');
0083
0084 for iprof = 1: length(dkepath.profilestr)
0085 if strcmp(cluster,'ANDROMEDE'),
0086 if strfind(dkepath.profilestr{iprof},'CEA_ANDROMEDE : direct'),
0087 break
0088 end
0089 elseif strcmp(cluster,'SIRRAH'),
0090 if strfind(dkepath.profilestr{iprof},'CEA_SIRRAH : direct'),
0091 break
0092 end
0093 end
0094 end
0095
0096 scheduler.remnum = iprof;
0097
0098 remote = dkepath.remote(scheduler.remnum);
0099 if remote_enforce == 0
0100 remote.link_mode='';
0101 else
0102 remote.link_mode=1;
0103 end
0104 job = matstandardjob_jd('runmat');
0105 if nargin > 1,
0106 [err,job,yout1,yout2,yout3,yout4,yout5] = matremote_jd('tsbase',{shotnumber,signal},remote,job);
0107 else
0108 [err,job,ydate] = matremote_jd('tsdate',{shotnumber},remote,job);
0109 end
0110
0111 end
0112 end