remotemdsplus

PURPOSE ^

MATREMOTE - Remote mdsplus database access

SYNOPSIS ^

function soutputs = remotemdsplus(sinputs)

DESCRIPTION ^

 MATREMOTE - Remote mdsplus database access

 Remote mdsplus database access 

 INPUTS : (see testremotebach.m for the remote parameters in the spinputs structure)

   - sinputs : structure for remote access and mds+ database

 OUTPUTS : 

   - soutputs is a cell array containing job output or error message if the job is completed

 by Y. Peysson (CEA/IRFM, yves.peysson@cea.fr) and J. Decker (CRPP/EPFL, joan.decker@epfl.ch)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function soutputs = remotemdsplus(sinputs)
0002 % MATREMOTE - Remote mdsplus database access
0003 %
0004 % Remote mdsplus database access
0005 %
0006 % INPUTS : (see testremotebach.m for the remote parameters in the spinputs structure)
0007 %
0008 %   - sinputs : structure for remote access and mds+ database
0009 %
0010 % OUTPUTS :
0011 %
0012 %   - soutputs is a cell array containing job output or error message if the job is completed
0013 %
0014 % by Y. Peysson (CEA/IRFM, yves.peysson@cea.fr) and J. Decker (CRPP/EPFL, joan.decker@epfl.ch)
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;%1;% (0) return hand (1) wait for result
0052     mdsplus_job.nodes = 1;%number of nodes required
0053     mdsplus_job.ppn = 1;%number of cores required
0054     mdsplus_job.memory = 2000;% memory required (in mb) - leave empty if no requirement
0055     mdsplus_job.walltime = 1;%[];% time required (integers - in hours) - leave empty if no requirement
0056     mdsplus_job.rempause = 1/60;% in minutes
0057     %
0058     mdsplus_job.remtimout = 10;% in minutes
0059     %
0060     try
0061         %
0062         mdsplus_job.env.remotematfnc = 'mdsplusload'; % matlab function to be called remotely by remotematrun (case of direct call)
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

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