- Timestamp:
- Feb 6, 2017, 4:02:20 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r994 r996 133 133 134 134 %% Read the parameter file series.xml, or created from series.xml.default if it does not exist 135 SeriesData=[]; 135 136 [path_series,name,ext]=fileparts(which('series'));% path to the GUI series 136 137 xmlfile=fullfile(path_series,'series.xml'); … … 140 141 if exist(xmlfile,'file') 141 142 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 % end146 % elseif ismember(RunMode,{'background','local'}) && isfield(s,'RunParam')147 % if isfield(s.RunParam,'NbCore')148 % NbCoreDefault=s.RunParam.NbCoreDefault;149 % end150 % end151 143 end 152 144 … … 291 283 292 284 %% introduce the input file name(s) if defined from input Param, 293 set(handles.series,'UserData', [])% initiate Userdata285 set(handles.series,'UserData',SeriesData)% initiate Userdata 294 286 if isfield(Param,'InputFile') 295 287 … … 593 585 end 594 586 set(handles.InputLine,'String',num2str(iline)); 595 % set(handles.InputTable,'UserData',iline);596 587 597 588 %------------------------------------------------------------------------ … … 678 669 set(handles.TimeTable,'Data',TimeTable(1:nbview,:)); 679 670 680 %% enable field and veltype menus, in accordance with the current action681 ActionName_Callback([],[], handles)682 683 671 %% set length of waitbar 684 672 displ_time(handles) 685 686 673 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH button to red color (indicate activation finished) 687 674 set(handles.series,'Pointer','arrow') % set the mouse pointer to 'watch' 675 676 %% enable field and veltype menus, in accordance with the current action 677 ActionInput_Callback([],[], handles) 678 688 679 689 680 %------------------------------------------------------------------------ … … 1438 1429 1439 1430 %% settings of the button RUN 1431 if ~isequal(get(handles.ActionInput,'BackgroundColor'),[1 0 0]) 1432 msgbox_uvmat('ERROR','first activate the button ActionInput') 1433 return 1434 end 1440 1435 set(handles.RUN,'BusyAction','queue'); % activation of STOP button will set BusyAction to 'cancel' 1441 1436 set(handles.RUN, 'Enable','Off')% avoid further RUN action until the current one is finished … … 1573 1568 NbCore=1; % no need to split the calculation 1574 1569 case 'cluster_oar' 1575 NbCoreDefault=SeriesData.SeriesParam.ClusterParam{1}.NbCoreDefault;%proposed number of cores (for cluster) 1576 %%%%% TEST A REMETTRE%%%%% 1577 % if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) 1578 % NbCore=1; % one core used only (limitation of Matlab licences) 1579 % answer=msgbox_uvmat('INPUT_Y-N','Number of cores =1: select the compiled version .sh for multi-core processing. Proceed with the .m version?'); 1580 % if ~strcmp(answer,'Yes') 1581 % errormsg='Action launch interrupted by user'; 1582 % return 1583 % end 1584 % extra_oar=''; 1585 % else 1586 answer=inputdlg({'Number of cores (max 36)','extra oar options'},'oarsub parameter',1,{num2str(NbCoreDefault),''}); 1570 NbCoreDefault=SeriesData.OarParam.NbCoreDefault;%proposed number of cores (for cluster) 1571 if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) 1572 warning_string=', preferably use .sh option to save Matlab licences'; 1573 else 1574 warning_string=''; 1575 end 1576 answer=inputdlg({['Number of cores (max 36)' warning_string],'extra oar options'},'oarsub parameter',1,{num2str(NbCoreDefault),''}); 1587 1577 if isempty(answer) 1588 1578 errormsg='Action launch interrupted by user'; … … 1684 1674 last_i=Param.IndexRange.last_i; 1685 1675 end 1686 if isfield(Param.IndexRange,' first_j')1676 if isfield(Param.IndexRange,'incr_j') 1687 1677 first_j=Param.IndexRange.first_j; 1688 1678 last_j=Param.IndexRange.last_j; … … 2145 2135 end 2146 2136 if exist(OutputDir,'dir') 2147 [SUCCESS,MESSAGE,MESSAGEID] = fileattrib (OutputDir) 2137 [SUCCESS,MESSAGE,MESSAGEID] = fileattrib (OutputDir); 2148 2138 if MESSAGE.GroupWrite~=1 2149 2139 [success,msg] = fileattrib(OutputDir,'+w','g','s'); % allow writing access for the group of users, recursively in the folder … … 2293 2283 update_waitbar(handles.Waitbar,0) 2294 2284 2295 %% create the function handle for Action2296 if ~exist(ActionPath,'dir')2297 msgbox_uvmat('ERROR',['The prescribed function path ' ActionPath ' does not exist']);2298 return2299 end2300 current_dir=pwd; % current working dir2301 cd(ActionPath)2302 h_fun=str2func(ActionName);2303 cd(current_dir)2304 2305 %2306 % checkaddpath=0;2307 % path_series=which('series');2308 % %eval(['spath=which(''' ActionName ''');']) %spath = current path of the selected function ACTION2309 % spath=fileparts(which(ActionName)); % spath = current path of the selected function ACTION2310 % if ~exist(ActionPath,'dir')2311 % msgbox_uvmat('ERROR',['The prescribed function path ' ActionPath ' does not exist']);2312 % return2313 % end2314 % if ~strcmp(spath,ActionPath)2315 % if strcmp(pwd,spath)2316 % msgbox_uvmat('ERROR',[ 'a function called ' ActionName ' on your working space oversets the selected one']);2317 % return2318 % else2319 % addpath(ActionPath)% add the prescribed path if not the current one2320 % checkaddpath=1;2321 % end2322 % end2323 % eval(['h_fun=@' ActionName ';'])%create a function handle for ACTION2324 % if checkaddpath && ~isequal(ActionPath,path_series)2325 % rmpath(ActionPath)% add the prescribed path if not the current one2326 % end2327 2328 %% Activate the Action fct to adapt the configuration of the GUI series and bring specific parameters in SeriesData2329 Param=read_GUI_series(handles); % read the parameters from the GUI series2330 ParamOut=h_fun(Param); % run the selected Action function to get the relevant input2331 2332 2285 %% Put the first line of the selected Action fct as tooltip help 2333 2286 try … … 2337 2290 set(handles.ActionName,'ToolTipString',InputText{1}{1})% put the first line of the selected function as tooltip help 2338 2291 end 2292 set(handles.ActionName,'BackgroundColor',[1 1 1]) 2293 set(handles.ActionInput,'BackgroundColor',[1 0 1])% set ActionInput button to magenta color to indicate that input refr 2294 2295 2296 % --- Executes on button press in ActionInput. 2297 function ActionInput_Callback(hObject, eventdata, handles) 2298 2299 set(handles.ActionInput,'BackgroundColor',[1 1 0]) 2300 2301 %% create the function handle for Action 2302 ActionPath=get(handles.ActionPath,'String'); 2303 ActionList=get(handles.ActionName,'String'); 2304 ActionName= ActionList{get(handles.ActionName,'Value')}; % selected function name 2305 if ~exist(ActionPath,'dir') 2306 msgbox_uvmat('ERROR',['The prescribed function path ' ActionPath ' does not exist']); 2307 return 2308 end 2309 current_dir=pwd; % current working dir 2310 cd(ActionPath) 2311 h_fun=str2func(ActionName); 2312 cd(current_dir) 2313 2314 %% Activate the Action fct to adapt the configuration of the GUI series and bring specific parameters in SeriesData 2315 Param=read_GUI_series(handles); % read the parameters from the GUI series 2316 ParamOut=h_fun(Param); % run the selected Action function to get the relevant input 2339 2317 2340 2318 … … 2542 2520 2543 2521 %% NbSlice visibility 2544 %NbSliceVisible='off'; % default2545 2522 if isfield(ParamOut,'NbSlice') && (strcmp(ParamOut.NbSlice,'on')||isnumeric(ParamOut.NbSlice)) 2546 2523 set(handles.num_NbSlice,'Visible','on') … … 2549 2526 set(handles.num_NbSlice,'Visible','off') 2550 2527 set(handles.NbSlice_title,'Visible','off') 2551 % set(handles.num_NbProcess,'String',get(handles.num_NbSlice,'String'))% the nbre of processes is imposed as the nbre of slices2552 % else2553 % set(handles.num_NbProcess,'String','')% free nbre of processes2554 2528 end 2555 2529 if isnumeric(ParamOut.NbSlice) … … 2559 2533 set(handles.num_NbSlice,'Enable','on'); % NbSlice can be modified on the GUI series 2560 2534 end 2561 % set(handles.num_NbSlice,'Visible',NbSliceVisible)2562 % set(handles.NbSlice_title,'Visible',NbSliceVisible)2563 2564 2565 2535 2566 2536 %% Visibility of FieldTransform menu … … 2612 2582 OutputSubDirMode=ParamOut.OutputSubDirMode; 2613 2583 end 2584 InputTable=get(handles.InputTable,'Data'); 2614 2585 switch OutputSubDirMode 2615 2586 case 'auto'; % default … … 2665 2636 %% definition of an additional parameter set, determined by an ancillary GUI 2666 2637 if isfield(ParamOut,'ActionInput') 2667 set(handles.ActionInput,'Visible','on')2638 % set(handles.ActionInput,'Visible','on') 2668 2639 ParamOut.ActionInput.Program=ActionName; % record the program in ActionInput 2669 2640 SeriesData.ActionInput=ParamOut.ActionInput; 2670 2641 else 2671 set(handles.ActionInput,'Visible','off')2642 % set(handles.ActionInput,'Visible','off') 2672 2643 if isfield(SeriesData,'ActionInput') 2673 2644 SeriesData=rmfield(SeriesData,'ActionInput'); … … 2675 2646 end 2676 2647 set(handles.series,'UserData',SeriesData) 2677 set(handles.Action Name,'BackgroundColor',[1 1 1])2648 set(handles.ActionInput,'BackgroundColor',[1 0 0]) 2678 2649 2679 2650 %------------------------------------------------------------------------ … … 3300 3271 end 3301 3272 if isfield(Param,'ActionInput')% introduce parameters specific to an Action fct, for instance PIV parameters 3302 set(handles.ActionInput,'Visible','on')3303 set(handles.ActionInput,'Value',0)3273 % set(handles.ActionInput,'Visible','on') 3274 % set(handles.ActionInput,'Value',0) 3304 3275 Param.ActionInput.ConfigSource=filexml; % record the source of config for future info 3305 3276 SeriesData.ActionInput=Param.ActionInput; … … 3770 3741 % --- Executes on button press in DiskQuota. 3771 3742 function DiskQuota_Callback(hObject, eventdata, handles) 3772 system('quota -s -g -A') 3743 SeriesData=get(handles.series,'UserData'); 3744 system(SeriesData.SeriesParam.DiskQuotaCmd) 3745 3746 3747 -
trunk/src/series.xml.default
r993 r996 1 1 <?xml version="1.0"?> 2 2 <SeriesParam> 3 <ClusterParam> 4 <Name>cluster_oar</Name>!-- Cluster name to be displayed in the menu 5 <CheckString>s=system('oarstat')</CheckString>!-- Matlab command for detecting the cluster 6 <NbCoreDefault>16</NbCoreDefault>!-- proposed number of cores by default 7 </ClusterParam> 8 <ClusterParam> 9 <Name>cluster_pbs</Name>!-- Cluster name to be displayed in the menu 10 </ClusterParam> 11 <ClusterParam> 12 <Name>cluster_sge</Name>!-- Cluster name to be displayed in the menu 13 CheckString>[s,w]=system('oarstat')</CheckString> 14 </ClusterParam> 3 <DiskQuotaCmd>quota -s -g -A</DiskQuotaCmd> 4 <OarParam> 5 <NbCoreDefault>16</NbCoreDefault><!--proposed default number of parallel cores for a job --> 6 <MinEstimatedCPUTime unit="minute">20</MinEstimatedCPUTime><!--used to group the iterations into jobs of sufficient CPU time--> 7 <MaxJobNumber>500</MaxJobNumber><!--maximum number of jobs allowed (will group the iterations to fit in)--> 8 <JobStatCmd>oarstat |grep N=UVmat</JobStatCmd> 9 </OarParam> 10 <SgeParam> 11 </SgeParam> 15 12 </SeriesParam> -
trunk/src/series/civ_series.m
r995 r996 439 439 end 440 440 end 441 par_civ1.ImageWidth=size(par_civ1.ImageA,2); %FileInfo_A.Width;442 par_civ1.ImageHeight=size(par_civ1.ImageA,1); %FileInfo_A.Height;441 par_civ1.ImageWidth=size(par_civ1.ImageA,2); 442 par_civ1.ImageHeight=size(par_civ1.ImageA,1); 443 443 list_param=(fieldnames(Param.ActionInput.Civ1))'; 444 444 list_param(strcmp('TestCiv1',list_param))=[];% remove the parameter TestCiv1 from the list
Note: See TracChangeset
for help on using the changeset viewer.