Changeset 1114 for trunk/src


Ignore:
Timestamp:
Mar 18, 2022, 12:31:32 PM (3 years ago)
Author:
sommeria
Message:

a few bugs repaired

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cluster_command.m

    r1019 r1114  
    2929WallTimeOneProcess=min(4*CPUTimeProcess+10,WallTimeTotal*60/2); % estimated max time of an individual process, used for checkpoint:
    3030                                                                %if less than this time remains before walltime, the job is stopped and a new one can be launched ( by the option 'idempotent')
    31 cmd=['oarsub -n UVmat_' ActionFullName ' '...
     31
     32      if NbCore==1
     33          corestring='cpu=1/core=4'; %increases the allowed memory in case of single core job
     34      else
     35          corestring=['/core=' num2str(NbCore)];
     36      end
     37                                                                cmd=['oarsub -n UVmat_' ActionFullName ' '...
    3238            '-t idempotent --checkpoint ' num2str(WallTimeOneProcess*60) ' '...
    33             '-l "/core=' num2str(NbCore)...
    34             bigiojob_string... % char(39) is quote - bigiojob limit UVmat parallel launch on cluster
     39            '-l "' corestring bigiojob_string... % char(39) is quote - bigiojob limit UVmat parallel launch on cluster
    3540            ',walltime=' datestr(WallTimeTotal/24,13) '" '...
    3641            '-E ' filename_errors ' '...
  • trunk/src/proj_field.m

    r1110 r1114  
    237237                    ProjData.(VarName)(ipoint,1)=mean(Var);
    238238                    if isequal(ObjectData.ProjMode,'interp_lin')
    239                          ProjData.(VarName)(ipoint,1)=griddata_uvmat(coord_x(indsel),coord_y(indsel),Var,Xpoint(1),Xpoint(2));
     239                         ProjData.(VarName)(ipoint,1)=griddata(coord_x(indsel),coord_y(indsel),Var,Xpoint(1),Xpoint(2));
    240240                    end
    241241               end
  • trunk/src/series.m

    r1113 r1114  
    15831583% NbCore is the number of computer processors used
    15841584% NbProcess is the number of independent processes in which the required calculation is split.
    1585 switch RunMode
    1586     case {'local','background'}
    1587         NbCore=1; % no need to split the calculation
    1588     case 'cluster'
    1589         %proposed number of cores to reserve in the cluster
    1590         NbCoreAdvised=SeriesData.SeriesParam.ClusterParam.NbCoreAdvised;
    1591         NbCoreMax=SeriesData.SeriesParam.ClusterParam.NbCoreMax;
    1592         if NbCoreMax~=1
    1593             if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled)
    1594                 warning_string=', preferably use .sh option to save Matlab licences';
    1595             else
    1596                 warning_string=')';
    1597             end
    1598             answer=msgbox_uvmat('INPUT_TXT',['Number of cores (max ' num2str(NbCoreMax) ', ' warning_string],num2str(NbCoreAdvised));
    1599             if isempty(answer)
    1600                 errormsg='Action launch interrupted by user';
    1601                 return
    1602             end
    1603             NbCore=str2double(answer);
    1604             if NbCore > NbCoreMax
    1605                 NbCore=NbCoreMax;
    1606             end
    1607         else
    1608             NbCore=1;
    1609         end
    1610 end
     1585% switch RunMode
     1586%     case {'local','background'}
     1587%         NbCore=1; % no need to split the calculation
     1588%     case 'cluster'
     1589%         %proposed number of cores to reserve in the cluster
     1590%         NbCoreAdvised=SeriesData.SeriesParam.ClusterParam.NbCoreAdvised;
     1591%         NbCoreMax=min(NbProcess,SeriesData.SeriesParam.ClusterParam.NbCoreMax);
     1592%         if NbCoreMax~=1
     1593%             if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled)
     1594%                 warning_string=', preferably use .sh option to save Matlab licences';
     1595%             else
     1596%                 warning_string=')';
     1597%             end
     1598%             answer=msgbox_uvmat('INPUT_TXT',['Number of cores (max ' num2str(NbCoreMax) ', ' warning_string],num2str(NbCoreAdvised));
     1599%             if isempty(answer)
     1600%                 errormsg='Action launch interrupted by user';
     1601%                 return
     1602%             end
     1603%             NbCore=str2double(answer);
     1604%             if NbCore > NbCoreMax
     1605%                 NbCore=NbCoreMax;
     1606%             end
     1607%         else
     1608%             NbCore=1;
     1609%         end
     1610% end
    16111611if ~isfield(Param.IndexRange,'NbSlice')
    16121612    Param.IndexRange.NbSlice=[];
     
    18661866    end
    18671867    nbfield_j=numel(ref_j); % number of j indices
    1868     BlockLength=numel(ref_i); % by default, job involves the full set of i field indices
     1868    BlockLength=numel(ref_i); % by default, job involves the full set of i field indicesNbProcess
    18691869    NbProcess=1;
     1870    NbCore=1;
    18701871    switch RunMode
    18711872        case 'cluster'
    1872             if (isfield(Param.Action, 'CPUTime') && ~isempty(Param.Action.CPUTime))
     1873            if (isfield(Param.Action, 'CPUTime') && ~isempty(Param.Action.CPUTime) && isnumeric(Param.Action.CPUTime))
    18731874                CPUTime=Param.Action.CPUTime; % Note: CpUTime for one iteration ref_i has to be multiplied by the number of j indices nbfield_j
    18741875            else
     
    18871888                NbProcess=Param.IndexRange.NbSlice; % the parameter NbSlice sets the nbre of run processes
    18881889            end
    1889             NbCore=min(NbCore,NbProcess); % reduces the number of cores if it exceeds the number of processes
     1890
     1891            %         %proposed number of cores to reserve in the cluster
     1892            NbCoreAdvised=SeriesData.SeriesParam.ClusterParam.NbCoreAdvised;
     1893            NbCoreMax=min(NbProcess,SeriesData.SeriesParam.ClusterParam.NbCoreMax);% reduces the number of cores if it exceeds the number of processes
     1894            if NbCoreMax~=1
     1895                if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled)
     1896                    warning_string=', preferably use .sh option to save Matlab licences';
     1897                else
     1898                    warning_string=')';
     1899                end
     1900                answer=msgbox_uvmat('INPUT_TXT',['Number of cores (max ' num2str(NbCoreMax) ', ' warning_string],num2str(NbCoreAdvised));
     1901                if isempty(answer)
     1902                    errormsg='Action launch interrupted by user';
     1903                    return
     1904                end
     1905                NbCore=str2double(answer);
     1906                if NbCore > NbCoreMax
     1907                    NbCore=NbCoreMax;
     1908                end
     1909            end
    18901910        otherwise
    18911911            if ~isempty(Param.IndexRange.NbSlice)
     
    18931913            end
    18941914    end
    1895    
     1915
    18961916    %% record nbre of output files and starting time for computation for status
    18971917    StatusData=get(handles.status,'UserData');
     
    19081928    StatusData.TimeStart=now;
    19091929    set(handles.status,'UserData',StatusData)
    1910    
     1930
    19111931    %% case of a function in Python
    19121932    if strcmp(ActionExt, '.py (in dev.)')
     
    24682488current_dir=pwd; % current working dir
    24692489cd(ActionPath)
    2470 h_fun=str2func(ActionName);
     2490h_fun=str2func(ActionName);% create the function handle for the function ActionName
    24712491cd(current_dir)
    24722492
     
    33583378TransformPathList=get(handles.TransformName,'UserData');
    33593379nb_builtin_transform=4;
    3360 if isequal(TransformName,'more...');     
     3380
     3381%% browse transform functions with the input menu option more...
     3382if isequal(TransformName,'more...')% browse transform functions     
    33613383    FileName=uigetfile_uvmat('Pick a transform function',get(handles.TransformPath,'String'),'.m');
    33623384    if isempty(FileName)
     
    33933415end
    33943416
    3395 %display the current function path
     3417%% display the current function path
    33963418set(handles.TransformPath,'String',TransformPathList{TransformIndex}); % show the path to the senlected function
    33973419set(handles.TransformName,'UserData',TransformPathList);
     
    34133435        ParamIn.TransformInput=SeriesData.TransformInput;
    34143436    end
    3415     DataOut=feval(transform_handle,Field,ParamIn);% execute the transform fct to get the required conditions
    3416     Field.Action.RUN=0; % indicate that the transform fct is called only to get input param
    3417     %DataOut=feval(transform_handle,Field,[]); % execute the transform fct to get the required conditions
     3437    DataOut=feval(transform_handle,Field,ParamIn);% execute the transform fct to get its input parameters
    34183438    if isfield(DataOut,'TransformInput')%  used to add transform parameters at selection of the transform fct
    34193439        SeriesData.TransformInput=DataOut.TransformInput;
  • trunk/src/series/merge_proj.m

    r1107 r1114  
    113113RootFile=Param.InputTable(:,3);
    114114SubDir=Param.InputTable(:,2);
    115 NomType=Param.InputTable(:,4);
     115% NomType=Param.InputTable(:,4);
    116116FileExt=Param.InputTable(:,5);
    117117
  • trunk/src/series/sliding_average.m

    r1107 r1114  
    1616% Param contains the elements:(use the menu bar command 'export/GUI config' in series to
    1717% see the current structure Param)
    18 %    .InputTable: cell of input file names, (several lines for multiple input)
     18%    .InputTable: cell of input file names, (several5.804 lines for multiple input)
    1919%                      each line decomposed as {RootPath,SubDir,Rootfile,NomType,Extension}
    2020%    .OutputSubDir: name of the subdirectory for data outputs
     
    179179if isfield(Param,'InputFields')
    180180    InputFields{1}=Param.InputFields;
    181 end
     181end5.804
    182182
    183183nbfiles=0;
    184184nbmissing=0;
    185185
    186 %% initialisation
     186%% initialisation manip Coriolis
    187187char_index=regexp(SubDir{1},'waves_L1_');
    188188switch(SubDir{1}(char_index+9))
     
    242242        break
    243243    end
    244     [Field,tild,errormsg] = read_field(filecell{1,index},FileType{iview},InputFields{iview},frame_index{iview}(index));
     244    [Field,tild,~] = read_field(filecell{1,index},FileType{iview},InputFields{iview},frame_index{iview}(index));
    245245   
    246246    %%%%%%%%%%% MAIN RUNNING OPERATIONS  %%%%%%%%%%%%
  • trunk/src/series/time_series.m

    r1110 r1114  
    214214
    215215%% coordinate transform or other user defined transform
    216 transform_fct=[];%default
     216transform_fct='';%default fct handle
    217217if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName)
    218     %addpath(Param.FieldTransform.TransformPath)
     218    currentdir=pwd;
     219    cd(Param.FieldTransform.TransformPath)
    219220    transform_fct=str2func(Param.FieldTransform.TransformName);
    220     %rmpath(Param.FieldTransform.TransformPath)
     221    cd (currentdir)
    221222    if isfield(Param,'TransformInput')
    222         XmlData{1}.TransformInput=Param.TransformInput;
    223     end
     223        for iview=1:NbView
     224            XmlData{iview}.TransformInput=Param.TransformInput;
     225        end
     226    end       
    224227end
    225228
Note: See TracChangeset for help on using the changeset viewer.