- Timestamp:
- Feb 6, 2017, 11:31:27 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r992 r994 132 132 end 133 133 134 %% list of builtin functions in the mebu ActionName 134 %% Read the parameter file series.xml, or created from series.xml.default if it does not exist 135 [path_series,name,ext]=fileparts(which('series'));% path to the GUI series 136 xmlfile=fullfile(path_series,'series.xml'); 137 if ~exist(xmlfile,'file') 138 [success,message]=copyfile(fullfile(path_series,'series.xml.default'),xmlfile); 139 end 140 if exist(xmlfile,'file') 141 SeriesData.SeriesParam=xml2struct(xmlfile); 142 % if ismember(RunMode,{'cluster_oar','cluster_pbs','cluster_sge'}) && isfield(s,'BatchParam') 143 % if isfield(s.BatchParam,'NbCoreDefault') 144 % NbCoreDefault=s.BatchParam.NbCoreDefault; 145 % end 146 % elseif ismember(RunMode,{'background','local'}) && isfield(s,'RunParam') 147 % if isfield(s.RunParam,'NbCore') 148 % NbCoreDefault=s.RunParam.NbCoreDefault; 149 % end 150 % end 151 end 152 153 %% list of builtin functions in the menu ActionName 135 154 ActionList={'check_data_files';'aver_stat';'time_series';'civ_series';'merge_proj'}; % WARNING: fits with nb_builtin_ACTION=4 in ActionName_callback 136 155 NbBuiltinAction=numel(ActionList); 137 156 set(handles.Action,'UserData',NbBuiltinAction) 157 path_series_fct=fullfile(path_series,'series');%path of the functions in subdirectroy 'series' 138 158 [path_series,name,ext]=fileparts(which('series')); % path to the GUI series 139 159 path_series_fct=fullfile(path_series,'series'); % path of the functions in subdirectroy 'series' … … 1491 1511 end 1492 1512 1493 %% Get PARAM.xml (not used at this stage)1513 %% Get parameters from series.xml 1494 1514 errormsg=''; % default error message 1495 xmlfile=fullfile(path_series,'PARAM.xml');1496 if ~exist(xmlfile,'file')1497 [success,message]=copyfile(fullfile(path_series,'PARAM.xml.default'),xmlfile);1498 end1499 if strcmp(ActionExt,'.sh')1500 if exist(xmlfile,'file')1501 s=xml2struct(xmlfile);1502 if (strcmp(RunMode,'cluster_oar') || strcmp(RunMode, 'cluster_pbs') || strcmp(RunMode, 'cluster_sge')) && isfield(s,'BatchParam')1503 if isfield(s.BatchParam,'NbCore')1504 NbCore=s.BatchParam.NbCore;1505 end1506 elseif (strcmp(RunMode,'background')||strcmp(RunMode,'local')) && isfield(s,'RunParam')1507 if isfield(s.RunParam,'NbCore')1508 NbCore=s.RunParam.NbCore;1509 end1510 end1511 end1512 end1513 1515 ActionFullName=fullfile(get(handles.ActionPath,'String'),ActionName); 1514 1516 … … 1571 1573 NbCore=1; % no need to split the calculation 1572 1574 case 'cluster_oar' 1575 NbCoreDefault=SeriesData.SeriesParam.ClusterParam{1}.NbCoreDefault;%proposed number of cores (for cluster) 1573 1576 %%%%% TEST A REMETTRE%%%%% 1574 1577 % if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) … … 1581 1584 % extra_oar=''; 1582 1585 % else 1583 answer=inputdlg({'Number of cores (max 36)','extra oar options'},'oarsub parameter',1,{ '16',''});1586 answer=inputdlg({'Number of cores (max 36)','extra oar options'},'oarsub parameter',1,{num2str(NbCoreDefault),''}); 1584 1587 if isempty(answer) 1585 1588 errormsg='Action launch interrupted by user'; … … 2516 2519 %% enable or desable j index visibility 2517 2520 status_j='on'; % default 2518 if isfield(ParamOut,'Desable_j_index')&&isequal(ParamOut.Desable_j_index,'on')2519 status_j='off';2520 end2521 2521 if isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)); % case of empty j indices 2522 2522 status_j='off'; % no j index needed … … 2528 2528 end 2529 2529 enable_j(handles,status_j) % no j index needed 2530 2530 if isfield(ParamOut,'j_index_1')&& isfield(ParamOut,'j_index_2')%strcmp(ParamOut.Desable_j_index,'on') 2531 %status_j='off'; 2532 set(handles.num_first_j,'String',num2str(ParamOut.j_index_1)) 2533 set(handles.num_last_j,'String',num2str(ParamOut.j_index_2)) 2534 set(handles.num_first_j,'enable','off') 2535 set(handles.num_last_j,'enable','off') 2536 set(handles.num_incr_j,'visible','off') 2537 else 2538 set(handles.num_first_j,'enable','on') 2539 set(handles.num_last_j,'enable','on') 2540 set(handles.num_incr_j,'visible',status_j) 2541 end 2531 2542 2532 2543 %% NbSlice visibility … … 3215 3226 transform_handle=str2func(TransformName); 3216 3227 cd(current_dir) 3228 Field.Action.RUN=0;% indicate that the transform fct is called only to get input param 3229 SeriesData=get(handles.series,'UserData'); 3230 ParamIn=[]; 3231 if isfield(SeriesData,'TransformInput') 3232 ParamIn.TransformInput=SeriesData.TransformInput; 3233 end 3234 DataOut=feval(transform_handle,Field,ParamIn);% execute the transform fct to get the required conditions 3217 3235 Field.Action.RUN=0; % indicate that the transform fct is called only to get input param 3218 3236 DataOut=feval(transform_handle,Field,[]); % execute the transform fct to get the required conditions 3219 3237 if isfield(DataOut,'TransformInput')% used to add transform parameters at selection of the transform fct 3220 SeriesData=get(handles.series,'UserData');3221 3238 SeriesData.TransformInput=DataOut.TransformInput; 3222 3239 set(handles.series,'UserData',SeriesData) … … 3744 3761 function CheckOverwrite_Callback(hObject, eventdata, handles) 3745 3762 3746 3747 3748 3763 % --- Executes on button press in TestCPUTime. 3749 3764 function TestCPUTime_Callback(hObject, eventdata, handles) … … 3753 3768 3754 3769 3755 3756 3757 3770 % --- Executes on button press in DiskQuota. 3771 function DiskQuota_Callback(hObject, eventdata, handles) 3772 system('quota -s -g -A')
Note: See TracChangeset
for help on using the changeset viewer.