0001 function soutputs = remotemdsplus(sinputs)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 if ~isfield(sinputs,'remote'),
0017 sinputs.remote.profile = '';
0018 sinputs.remote.link_mode = NaN;
0019 sinputs.remote.profilename = NaN;
0020 else
0021 if ~isfield(sinputs.remote,'profile'),
0022 sinputs.remote.profile = '';
0023 end
0024
0025 if ~isfield(sinputs.remote,'link_mode'),
0026 sinputs.remote.link_mode = NaN;
0027 end
0028
0029 if ~isfield(sinputs.remote,'profilename'),
0030 sinputs.remote.profilename = NaN;
0031 end
0032 end
0033
0034 if ~isfield(sinputs,'mdsplus'),
0035 soutputs.err = 'Error: ''mdsplus'' sub-structure must be setup first !';
0036 return;
0037 end
0038
0039 mdsplus_in = sinputs.mdsplus;
0040
0041 if isempty(sinputs.remote.profile) || strcmp(sinputs.remote.profile,'local'),
0042
0043 soutputs = mdsplusload(mdsplus_in);
0044
0045 else
0046
0047 [remote] = load_remoteprofiles_jd(sinputs.remote.profile,true,true,NaN,sinputs.remote.profilename,true,0,sinputs.remote.link_mode);
0048
0049 mdsplus_job = matstandardjob_jd;
0050
0051 mdsplus_job.wait = 0;
0052 mdsplus_job.nodes = 1;
0053 mdsplus_job.ppn = 1;
0054 mdsplus_job.memory = 2000;
0055 mdsplus_job.walltime = 1;
0056 mdsplus_job.rempause = 1/60;
0057
0058 mdsplus_job.remtimout = 10;
0059
0060 try
0061
0062 mdsplus_job.env.remotematfnc = 'mdsplusload';
0063
0064 mdsplus_job = remoterunbatch(remote,mdsplus_job,mdsplus_in,0);
0065
0066 if isfield(mdsplus_job,'err'),
0067 soutputs.err = mdsplus_job.err;
0068 else
0069 [~,soutputs] = remotegetbatch(mdsplus_job,0,0);
0070 end
0071
0072 catch job_err
0073 soutputs.err = job_err.message;
0074 end
0075 end
0076