Changeset 934
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/browse_data.m
r931 r934 87 87 88 88 %% initialize the GUI 89 if ~(exist('DataSeries','var') && exist(DataSeries,'dir'))89 if ~(exist('DataSeries','var') && ischar(DataSeries) && exist(DataSeries,'dir')) 90 90 DataSeries=pwd;% current dir is the starting data series by default 91 91 end … … 273 273 ListFiles=ListCells(1,:);%list of dir and file names 274 274 cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . ) 275 check_keep=cellfun('isempty', cell_remove); 275 cell_remove_tild=regexp(ListFiles,'~$');% detect tild the end of file nqme (do not list) 276 check_keep=cellfun('isempty', cell_remove) & cellfun('isempty', cell_remove_tild); 276 277 check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files 277 278 for ilist=1:numel(ListFiles) … … 282 283 else %update the list of dataSeries 283 284 [tild,msg]=fileattrib(mirror); 285 msg.Name=regexprep(msg.Name,'^/.','/');%remove the dot in /. at the beginning of the name 284 286 if ~strcmp(msg.Name,mirror)% if it is a link 285 287 ListFiles{ilist}=['~' ListFiles{ilist}];%mark link by '@' in the list -
trunk/src/series.m
r932 r934 469 469 RootPathCell=InputTable(:,1); 470 470 SubDirCell=InputTable(:,2); 471 oldfile=fullfile( RootPathCell{1},SubDirCell{1});471 oldfile=fullfile(InputTable{1,1},InputTable{1,2}); 472 472 if isempty(oldfile) 473 473 % use a file name stored in prefdir … … 481 481 end 482 482 end 483 %% launch the browser 484 fileinput=uigetfile_uvmat('pick an input file in the series',oldfile); 485 hh=dir(fileinput); 486 if numel(hh)>1 487 msgbox_uvmat('ERROR','invalid input, probably a broken link'); 488 else 489 if ~isempty(fileinput) 490 display_file_name(handles,fileinput,'one') 491 end 492 end 493 append='one'; 494 set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0]) 495 drawnow 496 browse_campaign(handles,append); 483 484 OutPut=browse_data(oldfile,'on','on');% open the GUI browse_data to get select a campaign dir, experiment and device 485 NbLines=numel(OutPut.Experiment)*numel(OutPut.DataSeries); 486 icount=0; 487 for iexp=1:numel(OutPut.Experiment) 488 for idevice=1:numel(OutPut.DataSeries) 489 icount=icount+1; 490 InputTable{icount,1}=fullfile(OutPut.Campaign,OutPut.Experiment{iexp}); 491 InputTable{icount,2}=OutPut.DataSeries{idevice}; 492 if isempty(InputTable{icount,3}) 493 if icount>1 494 InputTable{icount,3}=InputTable{icount-1,3}; 495 else 496 InputTable{icount,3}=''; 497 end 498 end 499 if isempty(InputTable{icount,4}) 500 if icount>1 501 InputTable{icount,4}=InputTable{icount-1,4}; 502 else 503 InputTable{icount,4}=''; 504 end 505 end 506 if isempty(InputTable{icount,5}) 507 if icount>1 508 InputTable{icount,5}=InputTable{icount-1,5}; 509 else 510 InputTable{icount,5}=''; 511 end 512 end 513 end 514 end 515 if size(InputTable,1)>icount 516 InputTable(icount+1:size(InputTable,1),:)=[]; 517 end 518 set(handles.InputTable,'Data',InputTable) 519 REFRESH_Callback(hObject, eventdata, handles) 520 % DataSeries=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1}); 521 % fileinput=uigetfile_uvmat('pick an input file',DataSeries); 522 % hh=dir(fileinput); 523 % if numel(hh)>1 524 % msgbox_uvmat('ERROR','invalid input, probably a broken link'); 525 % return 526 % end 527 % 528 % 529 % 530 % %% launch the browser 531 % fileinput=uigetfile_uvmat('pick an input file in the series',oldfile); 532 % hh=dir(fileinput); 533 % if numel(hh)>1 534 % msgbox_uvmat('ERROR','invalid input, probably a broken link'); 535 % else 536 % if ~isempty(fileinput) 537 % display_file_name(handles,fileinput,'one') 538 % end 539 % end 540 % append='one'; 541 % set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0]) 542 % drawnow 543 % browse_campaign(handles,append); 497 544 498 545 %------------------------------------------------------------------------ … … 1486 1533 errormsg='';%default error message 1487 1534 xmlfile=fullfile(path_series,'PARAM.xml'); 1488 %test_batch=0;%default: ,no batch mode available1489 1535 if ~exist(xmlfile,'file') 1490 1536 [success,message]=copyfile(fullfile(path_series,'PARAM.xml.default'),xmlfile); … … 1505 1551 end 1506 1552 ActionFullName=fullfile(get(handles.ActionPath,'String'),ActionName); 1507 %% If a compiled version has been selected (ext .sh) check weather it needs to be recompiled 1553 1554 %% If a compiled version has been selected (ext .sh) check wether it needs to be recompiled 1508 1555 if strcmp(ActionExt,'.sh') 1509 1556 TransformPath=''; … … 1515 1562 [mcrmajor, mcrminor] = mcrversion; 1516 1563 MCRROOT = ['MCRROOT',int2str(mcrmajor),int2str(mcrminor)]; 1517 %hver=ver('MATLAB');1518 %MCRROOT=['MCRROOT' regexprep(hver.Version,'\.','')];%suppress the dot in version number1519 1564 RunTime = getenv(MCRROOT); 1520 1565 ActionNameVersion=[ActionName '_' MCRROOT]; 1521 1566 ActionFullName=fullfile(get(handles.ActionPath,'String'),[ActionNameVersion '.sh']); 1567 % compile the .m file if the .sh file does not exist yet 1522 1568 if ~exist(ActionFullName,'file') 1523 1569 answer=msgbox_uvmat('INPUT_Y-N','compiled version has not been created: compile now?'); … … 1552 1598 end 1553 1599 end 1600 1554 1601 set(handles.ActionExt,'BackgroundColor',[1 1 1]) 1555 1602 set(handles.series,'Pointer','arrow') % set the mouse pointer to 'watch … … 1774 1821 if isempty(Param.IndexRange.NbSlice) 1775 1822 Param.IndexRange.first_i=first_i+(iprocess-1)*BlockLength*incr_i; 1776 % Param.IndexRange.first_i=ref_i(1+(iprocess-1)*BlockLength);1777 1823 if Param.IndexRange.first_i>last_i 1778 1824 NbProcess=iprocess-1;% leave the loop, we are at the end of the calculation 1779 1825 break 1780 1826 end 1781 %Param.IndexRange.last_i=min(ref_i(iprocess*BlockLength),last_i);1782 %Param.IndexRange.last_i=min(first_i+(iprocess)*BlockLength*incr_i-1,last_i);1783 1827 Param.IndexRange.last_i=min(last_i,first_i+(iprocess)*BlockLength*incr_i-1); 1784 1828 else %multislices (then incr_i is not empty) 1785 % Param.IndexRange.first_i= first_i+incr_i*(iprocess-1);1786 % Param.IndexRange.incr_i=incr_i*Param.IndexRange.NbSlice;1787 1829 Param.IndexRange.first_i= first_i+iprocess-1; 1788 1830 Param.IndexRange.incr_i=incr_i*Param.IndexRange.NbSlice; … … 1791 1833 Param.InputTable{ilist,1}=regexprep(Param.InputTable{ilist,1},'\','/');%correct path name for PCWIN system 1792 1834 end 1793 1794 % if isempty(Param.IndexRange.NbSlice)% process by blocks of i index1795 % Param.IndexRange.first_i=first_i+(iprocess-1)*BlockLength*incr_i;1796 % if Param.IndexRange.first_i>last_i1797 % NbProcess=iprocess-1;1798 % break% leave the loop, we are at the end of the calculation1799 % end1800 % Param.IndexRange.last_i=min(last_i,first_i+(iprocess)*BlockLength*incr_i-1);1801 % else% process by slices of i index if NbSlice is defined, computation in a single process if NbSlice =11802 % Param.IndexRange.first_i= first_i+iprocess-1;1803 % Param.IndexRange.incr_i=incr_i*Param.IndexRange.NbSlice;1804 % end1805 1806 1835 1807 1836 if isfield(Param,'OutputSubDir') … … 1819 1848 end 1820 1849 end 1821 % [success,msg] = fileattrib(filexml{iprocess},'+w','g');% allow writing access for the group of users, recursively in the folder1822 % if success==01823 % msgbox_uvmat('WARNING',{['unable to set group write access to ' filexml{iprocess} ':']; msg});%error message for directory creation1824 % end1825 1850 end 1826 1851 if strcmp (RunMode,'local') … … 1840 1865 end 1841 1866 end 1842 % [success,msg] = fileattrib(DirXml,'+w','g','s');% allow writing access for the group of users, recursively in the folder 1843 % if success==0 1844 % msgbox_uvmat('WARNING',{['unable to set group write access to ' DirXml ':']; msg});%error message for directory creation 1845 % end 1867 1846 1868 if ~strcmp (RunMode,'local') && ~strcmp(RunMode,'python') 1847 1869 %% processing on a different session of the same computer (background) or cluster, create executable files … … 1879 1901 first_i,last_i,first_j,last_j); 1880 1902 filelog_global=fullfile(OutputDir,'0_LOG',filelog_global); 1881 1882 % [success,msg] = fileattrib(DirLog,'+w','g','s');% allow writing access for the group of users, recursively in the folder 1883 % if success==0 1884 % msgbox_uvmat('WARNING',{['unable to set group write access to ' DirLog ':']; msg});%error message for directory creation 1885 % end 1886 % [success,msg] = fileattrib(fullfile(OutputDir,'0_EXE'),'+w','g','s');% allow writing access for the group of users, recursively in the folder 1887 % if success==0 1888 % msgbox_uvmat('WARNING',{['unable to set group write access to ' fullfile(OutputDir,'0_EXE') ':']; msg});%error message for directory creation 1889 % end 1890 % 1903 1891 1904 for iprocess=1:NbProcess 1892 1905 … … 1894 1907 1895 1908 batch_file_list{iprocess}=fullfile(OutputDir,'0_EXE',regexprep(extxml{iprocess},'.xml$',ExeExt)); 1896 % [fid,message]=fopen(batch_file_list{iprocess},'w');% create the executable file1897 % if isequal(fid,-1)1898 % errormsg=['creation of ' batch_file_list{iprocess} ':' message];1899 % return1900 % end1901 1909 1902 1910 % set the log file name … … 1958 1966 'hostname && date \n '... 1959 1967 'umask 002 \n'... 1960 ActionFullName ' ' RunTime ' ' filexml ];%allow writting access to created files for user group1968 ActionFullName ' ' RunTime ' ' filexml{iprocess}];%allow writting access to created files for user group 1961 1969 fprintf(fid,cmd);%fill the executable file with the char string cmd 1962 1970 fclose(fid);% close the executable file … … 1979 1987 return 1980 1988 end 1981 % [success,msg] = fileattrib(batch_file_list{iprocess},'+w','g');% allow writing access for the group of users, recursively in the folder1982 % if success==01983 % msgbox_uvmat('WARNING',{['unable to set group write access to ' batch_file_list{iprocess} ':']; msg});%error message for directory creation1984 % end1985 1989 if strcmp(ActionExt,'.sh') 1986 1990 cmd=['#!/bin/bash \n '... … … 2020 2024 filename_joblist=fullfile(DirOAR,'job_list.txt');% name of the file containing the list of executables 2021 2025 fid=fopen(filename_joblist,'w');%open it for writting 2022 % [success,msg] = fileattrib(filename_joblist,'+w','g');% allow writing access for the group of users,2023 2026 for iprocess=1:length(batch_file_list) 2024 2027 fprintf(fid,[batch_file_list{iprocess} '\n']);% write list of exe files … … 2053 2056 '-l ' filename_joblist '.log"']; 2054 2057 2055 2056 2057 2058 fprintf(oar_command);% display system command on the Matlab command window 2058 2059 [status,result]=system(oar_command)% execute system command and show the result (ID number of the launched job) on the Matlab command window … … 2063 2064 fclose(fid); 2064 2065 msgbox_uvmat('CONFIRMATION',[ActionFullName ' launched as ' num2str(NbProcess) ' processes in cluster: press STATUS to see results']) 2065 % [success,msg] = fileattrib(DirOAR,'+w','g','s');% allow writing access for the group of users, recursively in the folder2066 % if success==02067 % msgbox_uvmat('WARNING',{['unable to set group write access to ' DirOAR ':']; msg});%error message for directory creation2068 % end2069 2066 2070 2067 case 'cluster_pbs' % for LMFA Kepler machine … … 2121 2118 end 2122 2119 end 2120 2123 2121 %------------------------------------------------------------------------ 2124 2122 function STOP_Callback(hObject, eventdata, handles) … … 2128 2126 set(handles.RUN,'enable','on') 2129 2127 set(handles.RUN, 'Value',0) 2130 2131 2128 2132 2129 %------------------------------------------------------------------------ -
trunk/src/uvmat.m
r931 r934 488 488 % ----------------------------------------------------------------------- 489 489 function MenuBrowseCampaign_Callback(hObject, eventdata, handles) 490 set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0])491 drawnow490 % set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0]) 491 % drawnow 492 492 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 493 493 DataSeries=fullfile(RootPath,SubDir); 494 494 if isempty(DataSeries) %loads the previously stored file name and set it as default in the file_input box 495 495 DataSeries=get(handles.RootPath,'UserData'); 496 end497 % RootPath=get(handles.RootPath,'String');498 % if isempty(RootPath)499 % RootPath=get(handles.RootPath,'UserData');%use Rootpath recored from the personal file at uvmat opening500 % end501 % CampaignPath=fileparts(fileparts(RootPath));502 % DirFull=uigetfile_uvmat('define this path as the Campaign folder:',CampaignPath,'uigetdir');503 % %DirFull = uigetdir(CampaignPath,'Select a Campaign dir, then press OK');504 % if isempty(DirFull)505 % return506 % end507 if isempty(DataSeries)||~ischar(DataSeries)508 DataSeries=pwd;509 496 end 510 497 OutPut=browse_data(DataSeries,'on');% open the GUI browse_data to get select a campaign dir, experiment and device
Note: See TracChangeset
for help on using the changeset viewer.