Changeset 1097 for trunk/src/series.m


Ignore:
Timestamp:
Apr 11, 2021, 10:03:02 PM (3 years ago)
Author:
sommeria
Message:

various bug repairs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r1096 r1097  
    168168RunModeList={'local';'background'}; % default choice of extensions (Matlab fct .m or compiled version .sh)
    169169[s,w]=system(SeriesData.SeriesParam.ClusterParam.ExistenceTest); % look for cluster system presence
    170 % [s,w]=system('oarstat'); % look for cluster system 'oar'
    171170if isequal(s,0)
    172171    RunModeList=[RunModeList;{'cluster'}];
    173172    set(handles.MonitorCluster,'Visible','on'); % make visible button for access to Monika
    174173    set(handles.num_CPUTime,'Visible','on'); % make visible button for CPU time estimate for one ref index
    175     set(handles.num_CPUTime,'String','1')% defqult CPU time estimate 1 minute
     174    set(handles.num_CPUTime,'String','')% default CPU time undefined
    176175    set(handles.CPUTime_txt,'Visible','on'); % make visible button for CPU time title
    177176end
    178 % [s,w]=system('qstat -help'); % look for cluster system 'sge'
    179 % if isequal(s,0)
    180 %     if regexp(w,'^pbs')
    181 %         RunModeList=[RunModeList;{'cluster_pbs'}];
    182 %     elseif regexp(w,'^SGE')
    183 %         RunModeList=[RunModeList;{'cluster_sge'}];
    184 %     else
    185 %         RunModeList=[RunModeList;{'cluster_qstat_unknown'}];
    186 %     end
    187 % end
    188177set(handles.RunMode,'String',RunModeList)% display the menu of available run modes, local, background or cluster manager
    189178
     
    208197        end
    209198    end
    210     %get the list of previous campaigns in the upper bar menu Open campaign
    211 %     if isfield(h,'MenuCampaign')
    212 %         for ifile=1:min(length(h.MenuCampaign),5)
    213 %             set(handles.(['MenuCampaign_' num2str(ifile)]),'Label',h.MenuCampaign{ifile});
    214 %         end
    215 %     end
    216199    %get the menu of actions
    217200    if isfield(h,'ActionListUser') && iscell(h.ActionListUser) && isfield(h,'ActionPathListUser') && iscell(h.ActionPathListUser)
     
    287270if isfield(Param,'InputFile')
    288271   
    289     %% fill the list of file series
     272    %% fill the list of input file series
    290273    InputTable=[{Param.InputFile.RootPath},{Param.InputFile.SubDir},{Param.InputFile.RootFile},{Param.InputFile.NomType},{Param.InputFile.FileExt}];
    291     if isempty(find(cellfun('isempty',InputTable)==0)); % if there is no input file, do not introduce input info
     274    if isempty(find(cellfun('isempty',InputTable)==0)) % if there is no input file, do not introduce input info
    292275        set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed
    293276        return
     
    299282    end
    300283    set(handles.InputTable,'Data',InputTable)
     284   
     285    %% define the default path for the output files
     286    [InputPath,Device,DeviceExt]=fileparts(InputTable{1,1});
     287    [InputPath,Experiment,ExperimentExt]=fileparts(InputPath);
     288    set(handles.Device,'String',[Device DeviceExt])
     289    set(handles.Experiment,'String',[Experiment ExperimentExt])
     290    if ~isempty(regexp(InputTable{1,1},'(^http://)|(^https://)'))
     291    set(handles.OutputPathBrowse,'Value',1)% an output folder needs to be specified for OpenDAP data
     292    end
     293
     294    %update the output path if needed
     295    if ~(isfield(SeriesData,'InputPath') && strcmp(SeriesData.InputPath,InputPath))
     296    if get(handles.OutputPathBrowse,'Value')==1  % fix the output path in manual mode
     297        OutputPathOld=get(handles.OutputPath,'String');
     298        OutputPath=uigetdir(OutputPathOld,'pick a root folder for output data');
     299        set(handles.OutputPath,'String',OutputPath)
     300    else %reproduce the input path for output
     301        set(handles.OutputPath,'String',InputPath)
     302    end
     303    end
     304   
    301305    %% determine the selected reference field indices for pair display
    302306   
     
    857861[InputPath,Device,DeviceExt]=fileparts(InputTable{1,1});
    858862[InputPath,Experiment,ExperimentExt]=fileparts(InputPath);
    859 [~,InputPath,InputPathExt]=fileparts(InputPath);
    860863set(handles.Device,'String',[Device DeviceExt])
    861864set(handles.Experiment,'String',[Experiment ExperimentExt])
     
    18431846        end
    18441847    end
    1845     CPUTime=1; % job time estimated at 1 min per iteration (on index i and j) by default
    1846     if isfield(Param.Action, 'CPUTime') && ~isempty(Param.Action.CPUTime)
    1847         CPUTime=Param.Action.CPUTime; % Note: CpUTime for one iteration ref_i has to be multiplied by the number of j indices nbfield_j
    1848     end
     1848%     CPUTime=1; % job time estimated at 1 min per iteration (on index i and j) by default
     1849%     if isfield(Param.Action, 'CPUTime') && ~isempty(Param.Action.CPUTime)
     1850%         CPUTime=Param.Action.CPUTime; % Note: CpUTime for one iteration ref_i has to be multiplied by the number of j indices nbfield_j
     1851%     end
    18491852    nbfield_j=numel(ref_j); % number of j indices
    18501853    BlockLength=numel(ref_i); % by default, job involves the full set of i field indices
     
    18521855    switch RunMode
    18531856        case 'cluster'
     1857            if (isfield(Param.Action, 'CPUTime') && ~isempty(Param.Action.CPUTime))
     1858        CPUTime=Param.Action.CPUTime; % Note: CpUTime for one iteration ref_i has to be multiplied by the number of j indices nbfield_j
     1859            else
     1860               answer=msgbox_uvmat('INPUT_TXT','estimate the CPU time(in minutes) for each value of index i:' ,'');
     1861               CPUTime=str2num(answer);
     1862               set(handles.num_CPUTime,'String',answer)
     1863            end
    18541864            JobNumberMax=SeriesData.SeriesParam.ClusterParam.JobNumberMax;
    18551865            JobCPUTimeAdvised=SeriesData.SeriesParam.ClusterParam.JobCPUTimeAdvised;
     
    24242434set(handles.ActionName,'BackgroundColor',[1 1 1])
    24252435set(handles.ActionInput,'BackgroundColor',[1 0 1])% set ActionInput button to magenta color to indicate that input refr
    2426 
     2436set(handles.num_CPUTime,'String','')
    24272437
    24282438% --- Executes on button press in ActionInput.
     
    26372647    end
    26382648    if last_i < first_i || last_j < first_j , msgbox_uvmat('ERROR','last field number must be larger than the first one'),...
    2639             set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end;
     2649            set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end
    26402650end
    26412651
Note: See TracChangeset for help on using the changeset viewer.