Changeset 984 for trunk/src/series.m


Ignore:
Timestamp:
Jan 18, 2017, 3:37:05 PM (4 years ago)
Author:
sommeria
Message:

introduce .cine in various functions, improve stero PIV

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r983 r984  
    155155    set(handles.CPUTime_txt,'Visible','on'); % make visible button for access to Monika
    156156end
    157 [s,w]=system('qstat --version');% look for cluster system 'sge'
     157[s,w]=system('qstat -help');% look for cluster system 'sge'
    158158if isequal(s,0)
    159159    if regexp(w,'^pbs')
    160160        RunModeList=[RunModeList;{'cluster_pbs'}];
     161    elseif regexp(w,'^SGE')
     162        RunModeList=[RunModeList;{'cluster_sge'}];
    161163    else
    162         RunModeList=[RunModeList;{'cluster_sge'}];
    163     end
    164 end
    165 set(handles.RunMode,'String',RunModeList)
     164        RunModeList=[RunModeList;{'cluster_qstat_unknown'}];
     165    end
     166end
     167set(handles.RunMode,'String',RunModeList)% display the menu of available run modes, local, background or cluster manager
    166168
    167169%% list of builtin transform functions in the menu TransformName
     
    15021504    if exist(xmlfile,'file')
    15031505        s=xml2struct(xmlfile);
    1504         if strcmp(RunMode,'cluster_oar') && isfield(s,'BatchParam')
     1506        if (strcmp(RunMode,'cluster_oar') || strcmp(RunMode, 'cluster_pbs') || strcmp(RunMode, 'cluster_sge')) && isfield(s,'BatchParam')
    15051507            if isfield(s.BatchParam,'NbCore')
    15061508                NbCore=s.BatchParam.NbCore;
     
    15911593            extra_oar=answer{2};
    15921594 %       end
    1593     case 'cluster_pbs'
     1595    case {'cluster_pbs', 'cluster_sge', 'cluster_qstat_unknown'}
    15941596        if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled)
    15951597            NbCore=1;% one core used only (limitation of Matlab licences)
     
    16011603            extra_oar='';
    16021604        else
    1603             answer=inputdlg({'Number of cores (max 36)','extra oar options'},'oarsub parameter',1,{'12',''});
     1605            answer=inputdlg({'Number of jobs (max 1000)','Queue'},'qsub parameters',1,{'100','piv_debian'});
    16041606            NbCore=str2double(answer{1});
     1607            qstat_Queue=answer{2};
    16051608            %extra_oar=answer{2};%TODO : fix this for LMFA cluster. Maybe
    16061609            %extrs_oar and extra_pbs are not the best names
     
    17291732NbProcess=1;
    17301733switch RunMode
    1731     case {'cluster_oar','cluster_pbs'}
     1734    case {'cluster_oar','cluster_pbs','cluster_sge','cluster_qstat_unknown'}
    17321735        if isempty(Param.IndexRange.NbSlice)% if NbSlice is not defined
    17331736            BlockLength= ceil(20/(CPUTime*nbfield_j));% short iterations are grouped such that the minimum time of a process is 20 min.
     
    20592062        fclose(fid);
    20602063        system(['chmod +x ' filename_joblist]);% set the file to executable
    2061         pbs_command=['qstat -n CIVX '...
     2064        pbs_command=['qsub -n CIVX '...
    20622065            '-t idempotent --checkpoint ' num2str(walltime_onejob+60) ' '...
    20632066            '-l /core=' num2str(NbCore) ','...
     
    20652068            '-E ' regexprep(filename_joblist,'\.txt\>','.stderr') ' '...
    20662069            '-O ' regexprep(filename_joblist,'\.txt\>','.log') ' '...
    2067             extra_oar ' '...
     2070            extra_qstat ' '...
    20682071            '"oar-parexec -s -f ' filename_joblist ' '...
    20692072            '-l ' filename_joblist '.log"'];
     
    20752078        %system(pbs_command);
    20762079        msgbox_uvmat('CONFIRMATION',[ActionFullName ' command ready to be launched in cluster'])
     2080
     2081     case 'cluster_sge' % for PSMN
     2082        % Au PSMN, on ne crée pas 1 job avec plusieurs cœurs, mais N jobs de 1 cœurs
     2083        % où N < 1000.
     2084        %create subdirectory for pbs command and log files
     2085
     2086        DirSGE=fullfile(OutputDir,'0_SGE');
     2087        if exist(DirSGE,'dir')% delete the content of the dir 0_LOG to allow new input
     2088            curdir=pwd;
     2089            cd(DirSGE)
     2090            delete('*')
     2091            cd(curdir)
     2092        else
     2093            [tild,msg1]=mkdir(DirSGE);
     2094            if ~strcmp(msg1,'')
     2095                errormsg=['cannot create ' DirSGE ': ' msg1];%error message for directory creation
     2096                return
     2097            end
     2098        end
     2099        maxImgsPerJob = ceil(length(batch_file_list)/NbCore);
     2100        disp(['Max number of jobs: ' num2str(NbCore)])
     2101        disp(['Images per job: ' num2str(maxImgsPerJob)])
     2102       
     2103        iprocess = 1;
     2104        imgsInJob = [];
     2105        currJobIndex = 1;
     2106        done = 0;
     2107        while(~done)
     2108            if(iprocess <= length(batch_file_list))
     2109                imgsInJob = [imgsInJob, iprocess];
     2110            end
     2111            if((numel(imgsInJob) >= maxImgsPerJob) || (iprocess == length(batch_file_list)))
     2112                cmd=['#!/bin/sh \n'...
     2113                     '#$ -cwd \n'...
     2114                     'hostname && date\n']
     2115                for ii=1:numel(imgsInJob)
     2116                    cmd=[cmd ActionFullName ' /softs/matlab ' filexml{imgsInJob(ii)} '\n'];
     2117                end
     2118                [fid, message] = fopen([DirSGE '/job' num2str(currJobIndex) '.sh'], 'w');
     2119                fprintf(fid, cmd);
     2120                fclose(fid);
     2121                system(['chmod +x ' DirSGE '/job' num2str(currJobIndex) '.sh'])
     2122                sge_command=['qsub -N civ_' num2str(currJobIndex) ' '...
     2123                    '-q ' qstat_Queue ' '...
     2124                    '-e ' fullfile([DirSGE '/job' num2str(currJobIndex) '.out']) ' '...
     2125                    '-o ' fullfile([DirSGE '/job' num2str(currJobIndex) '.out']) ' '...
     2126                    fullfile([DirSGE '/job' num2str(currJobIndex) '.sh'])];
     2127                fprintf(sge_command);% display in command line
     2128                [status, result] = system(sge_command);
     2129                fprintf(result);
     2130                currJobIndex = currJobIndex + 1;
     2131                imgsInJob = [];
     2132            end
     2133            if(iprocess == length(batch_file_list))
     2134                done = 1;
     2135            end
     2136            iprocess = iprocess + 1;
     2137        end
     2138        msgbox_uvmat('CONFIRMATION',[num2str(currJobIndex-1) ' jobs launched on queue ' qstat_Queue '.'])
    20772139    case 'python'
    20782140        command = [
     
    23562418            end
    23572419        end
     2420    else
     2421        set(handles.FieldName,'Visible','off')
    23582422    end
    23592423   
     
    23822446            end
    23832447            if warn_coord
    2384                 msgbox_uvmat('WARNING','coordiante names do not exist in the second netcdf input file')
     2448                msgbox_uvmat('WARNING','coordinate names do not exist in the second netcdf input file')
    23852449            end
    23862450           
Note: See TracChangeset for help on using the changeset viewer.