Changeset 932 for trunk/src


Ignore:
Timestamp:
Mar 15, 2016, 12:29:15 PM (9 years ago)
Author:
sommeria
Message:

writting access improved

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r924 r932  
    12901290h=findobj(haxes,'Tag','vel');% search existing lines in the current axes
    12911291sizh=size(h);
    1292 set(h,'EraseMode','xor');
     1292%set(h,'EraseMode','xor');
    12931293set(haxes,'NextPlot','replacechildren');
    12941294
     
    13461346            set(h(2*icolor-1),'Xdata',matx,'Ydata',maty);
    13471347            set(h(2*icolor-1),'Color',colorlist(icolor,:));
    1348             set(h(2*icolor-1),'EraseMode','xor');
     1348%            set(h(2*icolor-1),'EraseMode','xor');
    13491349            set(h(2*icolor),'Xdata',matxar,'Ydata',matyar);
    13501350            set(h(2*icolor),'Color',colorlist(icolor,:));
    1351             set(h(2*icolor),'EraseMode','xor');
     1351            %set(h(2*icolor),'EraseMode','xor');
    13521352        end
    13531353    end
  • trunk/src/series.m

    r928 r932  
    16441644            return
    16451645        end
    1646         [success,msg] = fileattrib(OutputDir,'+w','g','s');% allow writing access for the group of users, recursively in the folder 
    1647         if success==0
    1648             msgbox_uvmat('WARNING',{['unable to set group write access to ' OutputDir ':']; msg1});%error message for directory creation
    1649         end
    16501646    end
    16511647   
     
    16591655        errormsg=['cannot create ' DirXml ': ' msg1];%error message for directory creation
    16601656        return
    1661     end
    1662     [success,msg] = fileattrib(DirXml,'+w','g','s');% allow writing access for the group of users, recursively in the folder
    1663     if success==0
    1664         msgbox_uvmat('WARNING',{['unable to set group write access to ' DirXml ':']; msg});%error message for directory creation
    16651657    end
    16661658end
     
    16841676    incr_j=Param.IndexRange.incr_j;
    16851677end
    1686 if last_i < first_i || last_j < first_j 
     1678if last_i < first_i || last_j < first_j
    16871679    errormsg= 'series/Run_Callback:last field index must be larger or equal to the first one';
    16881680    return
     
    17071699        ref_i=ref_i(ref_i>=first_i & ref_i<=last_i);
    17081700    end
    1709 % increment i is defined: processing is done on first_i:incr_i:last_i;
     1701    % increment i is defined: processing is done on first_i:incr_i:last_i;
    17101702else
    17111703    ref_i=first_i:incr_i:last_i;
     
    17231715end
    17241716nbfield_j=numel(ref_j); % number of j indices
    1725 BlockLength=numel(ref_i);% by default, job involves the full set of i field indices 
     1717BlockLength=numel(ref_i);% by default, job involves the full set of i field indices
    17261718NbProcess=1;
    17271719switch RunMode
    17281720    case {'cluster_oar','cluster_pbs'}
    17291721        if isempty(Param.IndexRange.NbSlice)% if NbSlice is not defined
    1730              BlockLength= ceil(20/(CPUTime*nbfield_j));% short iterations are grouped such that the minimum time of a process is 20 min.
    1731              BlockLength=max(BlockLength,ceil(numel(ref_i)/500));% possibly increase the BlockLength to have less than 500 jobs
    1732              NbProcess=ceil(numel(ref_i)/BlockLength) ; % nbre of processes sent to oar
     1722            BlockLength= ceil(20/(CPUTime*nbfield_j));% short iterations are grouped such that the minimum time of a process is 20 min.
     1723            BlockLength=max(BlockLength,ceil(numel(ref_i)/500));% possibly increase the BlockLength to have less than 500 jobs
     1724            NbProcess=ceil(numel(ref_i)/BlockLength) ; % nbre of processes sent to oar
    17331725        else
    17341726            NbProcess=Param.IndexRange.NbSlice;% the parameter NbSlice sets the nbre of run processes
     
    17361728        end
    17371729    otherwise
    1738          if ~isempty(Param.IndexRange.NbSlice)
    1739              NbProcess=Param.IndexRange.NbSlice;% the parameter NbSlice sets the nbre of run processes
    1740          end
     1730        if ~isempty(Param.IndexRange.NbSlice)
     1731            NbProcess=Param.IndexRange.NbSlice;% the parameter NbSlice sets the nbre of run processes
     1732        end
    17411733end
    17421734
     
    17491741        case 'NbInput_i'
    17501742            StatusData.NbOutputFile=numel(ref_i);
    1751         case 'NbSlice'   
     1743        case 'NbSlice'
    17521744            StatusData.NbOutputFile=str2num(get(handles.num_NbSlice,'String'));
    17531745    end
     
    18271819            end
    18281820        end
     1821        %         [success,msg] = fileattrib(filexml{iprocess},'+w','g');% allow writing access for the group of users, recursively in the folder
     1822        %     if success==0
     1823        %         msgbox_uvmat('WARNING',{['unable to set group write access to ' filexml{iprocess} ':']; msg});%error message for directory creation
     1824        %     end
    18291825    end
    18301826    if strcmp (RunMode,'local')
     
    18321828            case '.m'
    18331829                h_fun(Param);% direct launching
     1830               
    18341831            case '.sh'
    18351832                switch computer
     
    18431840    end
    18441841end
    1845 
     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
    18461846if ~strcmp (RunMode,'local') && ~strcmp(RunMode,'python')
    18471847    %% processing on a different session of the same computer (background) or cluster, create executable files
     
    18711871        end
    18721872    end
     1873   
    18731874    %create the executable file
    18741875    file_exe_global=fullfile_uvmat('','',Param.InputTable{1,3},ExeExt,OutputNomType,...
     
    18791880    filelog_global=fullfile(OutputDir,'0_LOG',filelog_global);
    18801881   
    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    %
    18821891    for iprocess=1:NbProcess
    18831892       
     
    18851894       
    18861895        batch_file_list{iprocess}=fullfile(OutputDir,'0_EXE',regexprep(extxml{iprocess},'.xml$',ExeExt));
    1887 %         [fid,message]=fopen(batch_file_list{iprocess},'w');% create the executable file
    1888 %         if isequal(fid,-1)
    1889 %             errormsg=['creation of ' batch_file_list{iprocess} ':' message];
    1890 %             return
    1891 %         end
     1896        %         [fid,message]=fopen(batch_file_list{iprocess},'w');% create the executable file
     1897        %         if isequal(fid,-1)
     1898        %             errormsg=['creation of ' batch_file_list{iprocess} ':' message];
     1899        %             return
     1900        %         end
    18921901       
    18931902        % set the log file name
     
    19641973    case 'cluster_oar' % option 'oar-parexec' used
    19651974        %create subdirectory for oar commands
    1966         for iprocess=1:NbProcess           
     1975        for iprocess=1:NbProcess
    19671976            [fid,message]=fopen(batch_file_list{iprocess},'w');% create the executable file
    19681977            if isequal(fid,-1)
     
    19701979                return
    19711980            end
     1981            %             [success,msg] = fileattrib(batch_file_list{iprocess},'+w','g');% allow writing access for the group of users, recursively in the folder
     1982            %     if success==0
     1983            %         msgbox_uvmat('WARNING',{['unable to set group write access to ' batch_file_list{iprocess} ':']; msg});%error message for directory creation
     1984            %     end
    19721985            if  strcmp(ActionExt,'.sh')
    1973             cmd=['#!/bin/bash \n '...
    1974                 '#$ -cwd \n '...
    1975                 'hostname && date \n '...
    1976                 'umask 002 \n'...
    1977                 ActionFullName ' ' RunTime ' ' filexml{iprocess}];%allow writting access to created files for user group
     1986                cmd=['#!/bin/bash \n '...
     1987                    '#$ -cwd \n '...
     1988                    'hostname && date \n '...
     1989                    'umask 002 \n'...
     1990                    ActionFullName ' ' RunTime ' ' filexml{iprocess}];%allow writting access to created files for user group
    19781991            else
    19791992                cmd=[...
    1980                             '#!/bin/bash \n'...
    1981                             '. /etc/sysprofile \n'...
    1982                             'matlab -nodisplay -nosplash -nojvm -logfile ''' filelog{iprocess} ''' <<END_MATLAB \n'...
    1983                             'addpath(''' path_series '''); \n'...
    1984                             'addpath(''' Param.Action.ActionPath '''); \n'...
    1985                             '' Param.Action.ActionName  '( ''' filexml{iprocess} '''); \n'...
    1986                             'exit \n'...
    1987                             'END_MATLAB \n'];
     1993                    '#!/bin/bash \n'...
     1994                    '. /etc/sysprofile \n'...
     1995                    'matlab -nodisplay -nosplash -nojvm -logfile ''' filelog{iprocess} ''' <<END_MATLAB \n'...
     1996                    'addpath(''' path_series '''); \n'...
     1997                    'addpath(''' Param.Action.ActionPath '''); \n'...
     1998                    '' Param.Action.ActionName  '( ''' filexml{iprocess} '''); \n'...
     1999                    'exit \n'...
     2000                    'END_MATLAB \n'];
    19882001            end
    19892002            fprintf(fid,cmd);%fill the executable file with the  char string cmd
     
    20052018        end
    20062019        % create file containing the list of jobs
    2007         filename_joblist=fullfile(DirOAR,'job_list.txt');% name of the file contqining the list of executables
     2020        filename_joblist=fullfile(DirOAR,'job_list.txt');% name of the file containing the list of executables
    20082021        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,
    20092023        for iprocess=1:length(batch_file_list)
    20102024            fprintf(fid,[batch_file_list{iprocess} '\n']);% write list of exe files
     
    20362050            '-O ' filename_log ' '...
    20372051            extra_oar ' '...
    2038            '"oar-parexec -s -f ' filename_joblist ' '...
     2052            '"oar-parexec -s -f ' filename_joblist ' '...
    20392053            '-l ' filename_joblist '.log"'];
    20402054       
    2041 
     2055       
    20422056       
    20432057        fprintf(oar_command);% display  system command on the Matlab command window
     
    20492063        fclose(fid);
    20502064        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 folder
     2066        %     if success==0
     2067        %         msgbox_uvmat('WARNING',{['unable to set group write access to ' DirOAR ':']; msg});%error message for directory creation
     2068        %     end
    20512069       
    20522070    case 'cluster_pbs' % for LMFA Kepler machine
     
    20972115        system(command, '-echo');
    20982116end
    2099 
     2117if exist(OutputDir,'dir')
     2118    [success,msg] = fileattrib(OutputDir,'+w','g','s');% allow writing access for the group of users, recursively in the folder
     2119    if success==0
     2120        msgbox_uvmat('WARNING',{['unable to set group write access to ' OutputDir ':']; msg1});%error message for directory creation
     2121    end
     2122end
    21002123%------------------------------------------------------------------------
    21012124function STOP_Callback(hObject, eventdata, handles)
  • trunk/src/series/civ_input.m

    r924 r932  
    721721            numlist_a(index)=numod_a;
    722722            numlist_b(index)=numod_b;
    723             if size(time,2)>1 && ~checkframe
     723            if size(time,2)>1 && ~checkframe && size(CivInputData.Time,1)>ref_i && size(CivInputData.Time,2)>numod_b
    724724                dt(numod_a,numod_b)=CivInputData.Time(ref_i+1,numod_b+1)-CivInputData.Time(ref_i+1,numod_a+1);%first time interval dt
    725725                displ_dt(index)=dt(numod_a,numod_b);
  • trunk/src/series/civ_series.m

    r924 r932  
    890890        if isempty(errormsg)
    891891            disp([ncfile_out ' written'])
     892            [success,msg] = fileattrib(ncfile_out ,'+w','g');% allow writing access for the group of users, recursively in the folder
    892893        else
    893894            disp(errormsg)
  • trunk/src/series/extract_rdvision.m

    r931 r932  
    451451uid_Dtj=find(t,'ImaDoc/Camera/BurstTiming/Dtj');
    452452uid_content=get(t,uid_Dtj,'contents');
    453 Dtj=str2num(get(t,uid_content,'value'));
    454 nbfield2=numel(Dtj)+1;
    455 timestamp=(reshape(timestamp,nbfield2,[]))';
    456 diff_Dtj=diff(timestamp(1,:))-Dtj;
    457 if max(abs(diff_Dtj))>min(Dtj)/1000
    458     disp(['Dtj from xml file differs from time stamp by ' num2str(max(abs(diff_Dtj))) ', '])%'
     453Dtjstring=get(t,uid_content,'value');
     454if isempty(Dtjstring)
     455    timestamp=timestamp';
     456    nbfield2=1;
    459457else
    460     disp('Dtj OK');
    461 end
    462 
     458    Dtj=str2num(get(t,uid_content,'value'));
     459    nbfield2=numel(Dtj)+1;
     460    timestamp=(reshape(timestamp,nbfield2,[]))';
     461    diff_Dtj=diff(timestamp(1,:))-Dtj;
     462    if max(abs(diff_Dtj))>min(Dtj)/1000
     463        disp(['Dtj from xml file differs from time stamp by ' num2str(max(abs(diff_Dtj))) ', '])%'
     464    else
     465        disp('Dtj OK');
     466    end
     467end
    463468%% correct NbDti
    464469NbDti=size(timestamp,1); %default for series or burst
     
    503508
    504509save(t,newxml)
    505 
    506 
    507 
    508 
     510       [success,msg] = fileattrib(newxml,'+w','g');% allow writing access for the group of users 
     511        if success==0
     512            msgbox_uvmat('WARNING',{['unable to set group write access to ' newxml ':']; msg1});%error message for directory creation
     513        end
     514
     515
     516
Note: See TracChangeset for help on using the changeset viewer.