0001 function dkepath = lukeschedulerparam(dkepath,mdce_mode,remnum,returnmode,transpmode,opt_gui,style)
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
0036
0037
0038
0039
0040 if nargin < 7,
0041 style = struct;
0042 end
0043 if nargin < 6,
0044 opt_gui = false;
0045 end
0046 if nargin < 5,
0047 transpmode = false;
0048 end
0049 if nargin < 4,
0050 returnmode = [];
0051 end
0052 if nargin < 3,
0053 remnum = [];
0054 end
0055 if nargin < 2,
0056 mdce_mode = [];
0057 end
0058 if nargin < 1 || isempty(dkepath) || any(~isfield(dkepath,{'remote','distprofiles','remprofiles'})),
0059 dkepath = load_structures_yp('dkepath','','');
0060 end
0061
0062 nrem = length(dkepath.remote);
0063
0064
0065
0066 if isfield(dkepath,'clustermode') && isfield(dkepath.clustermode,'run_lukert') && isfield(dkepath.clustermode.run_lukert,'scheduler'),
0067 scheduler = dkepath.clustermode.run_lukert.scheduler;
0068 else
0069 scheduler = struct;
0070 end
0071
0072 if isempty(mdce_mode),
0073 if isfield(scheduler,'mode') && isscalar(scheduler.mode) && isnumeric(scheduler.mode) && any(scheduler.mode == -nrem:2),
0074 mdce_mode = scheduler.mode;
0075 if mdce_mode < 0,
0076 mdce_mode = 2 - mdce_mode;
0077 end
0078 else
0079 mdce_mode = 0;
0080 end
0081 mdce_mode = iselect_jd(dkepath.distprofiles,'Distribution of calc. : ',opt_gui,style,1 + mdce_mode,'popupmenu') - 1;
0082 if mdce_mode > 2,
0083 mdce_mode = 2 - mdce_mode;
0084 end
0085 elseif ~isscalar(mdce_mode) || ~isnumeric(mdce_mode) || ~any(mdce_mode == -nrem:3),
0086 disp('WARNING : invalid choice entered for mdce_mode. Sequential mode enforced.');
0087 mdce_mode = 0;
0088 end
0089
0090 if isempty(remnum),
0091 if isfield(scheduler,'remnum') && isscalar(scheduler.remnum) && isnumeric(scheduler.remnum) && any(scheduler.remnum == 0:nrem),
0092 remnum = scheduler.remnum;
0093 else
0094 remnum = 0;
0095 end
0096 remnum = iselect_jd(dkepath.remprofiles,'Where do you want to run LUKE ?',opt_gui,style,1 + remnum,'popupmenu') - 1;
0097 elseif ~isscalar(remnum) || ~isnumeric(remnum) || ~any(remnum == 0:nrem),
0098 disp('WARNING : invalid choice entered for remnum. Local calculation enforced.');
0099 remnum = 0;
0100 end
0101
0102 if isempty(returnmode) && (mdce_mode < 0 || remnum > 0),
0103 if isfield(scheduler,'remtimout') && scheduler.remtimout == 0,
0104 waitstr = 'n';
0105 else
0106 waitstr = 'y';
0107 end
0108 returnmode = input_dke_yp('Do you want to wait for results (y/n)',waitstr,{'y','n'}) == 'n';
0109 elseif isempty(returnmode) || (remnum == 0 && mdce_mode >= 0),
0110 returnmode = false;
0111 end
0112 if ~isscalar(returnmode) || (~islogical(returnmode) && (~isnumeric(returnmode) || ~any(returnmode == 0:1))),
0113 disp('WARNING : invalid choice entered for returnmode. Waiting for results.');
0114 returnmode = false;
0115 elseif returnmode && mdce_mode > 0 && remnum == 0,
0116 disp('WARNING : returnmode enforced to ''off'' for local distributed calculation with mdce_mode == 1,2.');
0117 returnmode = false;
0118 end
0119
0120 if isstruct(transpmode),
0121 if (isfield(transpmode,'Dr0') && transpmode.Dr0 > 0) || (isfield(transpmode,'Vr0') && transpmode.Vr0 ~= 0),
0122 transpmode = true;
0123 else
0124 transpmode = false;
0125 end
0126 elseif isempty(transpmode),
0127 transpmode = false;
0128 elseif ~isscalar(transpmode) || (~islogical(transpmode) && (~isnumeric(transpmode) || ~any(transpmode == 0:1))),
0129 disp('WARNING : invalid choice entered for transpmode. transpmode == false enforced.');
0130 transpmode = false;
0131 end
0132
0133 dkepath.clustermode.run_lukert.scheduler.mode = mdce_mode;
0134 dkepath.clustermode.run_lukert.scheduler.remnum = remnum;
0135 if returnmode,
0136 dkepath.clustermode.run_lukert.scheduler.remtimout = 0;
0137 else
0138 dkepath.clustermode.run_lukert.scheduler.remtimout = 60*24;
0139 end
0140 if(isfield(dkepath,'luke_memory') && ~isempty(dkepath.luke_memory))
0141 dkepath.clustermode.run_lukert.scheduler.memory = dkepath.luke_memory;
0142 else
0143 if transpmode,
0144 dkepath.clustermode.run_lukert.scheduler.memory = 14000;
0145 else
0146 dkepath.clustermode.run_lukert.scheduler.memory = 7000;
0147 end
0148 end
0149
0150 dkepath.clustermode.run_lukert.scheduler.walltime = 24;
0151 dkepath.clustermode.run_lukert.scheduler.enforce = 0+2i;
0152
0153 if dkepath.clustermode.run_lukert.scheduler.remnum > 0,
0154 if strcmp(dkepath.remote(dkepath.clustermode.run_lukert.scheduler.remnum).scheduler,'torque') | strcmp(dkepath.remote(dkepath.clustermode.run_lukert.scheduler.remnum).scheduler,'pbs'),
0155 queuemode = input_dke_yp('Do you want to see queuing parameters for ''torque'' or ''pbs'' schedulers (y/n)','n',{'y','n'}) == 'y';
0156 if queuemode,
0157
0158 disp('----------------------------- default queue parameters ----------------------------')
0159 disp(' ')
0160 disp(dkepath.remote(dkepath.clustermode.run_lukert.scheduler.remnum).queue);
0161 disp('-----------------------------------------------------------------------------------');
0162 disp('WARNING: the queue parameters may be changed in remote profiles (MatRemote toolbox)');
0163 disp('-----------------------------------------------------------------------------------');
0164 end
0165 end
0166 end
0167 end