Changeset 984 for trunk/src/series.m
- Timestamp:
- Jan 18, 2017, 3:37:05 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r983 r984 155 155 set(handles.CPUTime_txt,'Visible','on'); % make visible button for access to Monika 156 156 end 157 [s,w]=system('qstat - -version');% look for cluster system 'sge'157 [s,w]=system('qstat -help');% look for cluster system 'sge' 158 158 if isequal(s,0) 159 159 if regexp(w,'^pbs') 160 160 RunModeList=[RunModeList;{'cluster_pbs'}]; 161 elseif regexp(w,'^SGE') 162 RunModeList=[RunModeList;{'cluster_sge'}]; 161 163 else 162 RunModeList=[RunModeList;{'cluster_ sge'}];163 end 164 end 165 set(handles.RunMode,'String',RunModeList) 164 RunModeList=[RunModeList;{'cluster_qstat_unknown'}]; 165 end 166 end 167 set(handles.RunMode,'String',RunModeList)% display the menu of available run modes, local, background or cluster manager 166 168 167 169 %% list of builtin transform functions in the menu TransformName … … 1502 1504 if exist(xmlfile,'file') 1503 1505 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') 1505 1507 if isfield(s.BatchParam,'NbCore') 1506 1508 NbCore=s.BatchParam.NbCore; … … 1591 1593 extra_oar=answer{2}; 1592 1594 % end 1593 case 'cluster_pbs'1595 case {'cluster_pbs', 'cluster_sge', 'cluster_qstat_unknown'} 1594 1596 if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) 1595 1597 NbCore=1;% one core used only (limitation of Matlab licences) … … 1601 1603 extra_oar=''; 1602 1604 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'}); 1604 1606 NbCore=str2double(answer{1}); 1607 qstat_Queue=answer{2}; 1605 1608 %extra_oar=answer{2};%TODO : fix this for LMFA cluster. Maybe 1606 1609 %extrs_oar and extra_pbs are not the best names … … 1729 1732 NbProcess=1; 1730 1733 switch RunMode 1731 case {'cluster_oar','cluster_pbs' }1734 case {'cluster_oar','cluster_pbs','cluster_sge','cluster_qstat_unknown'} 1732 1735 if isempty(Param.IndexRange.NbSlice)% if NbSlice is not defined 1733 1736 BlockLength= ceil(20/(CPUTime*nbfield_j));% short iterations are grouped such that the minimum time of a process is 20 min. … … 2059 2062 fclose(fid); 2060 2063 system(['chmod +x ' filename_joblist]);% set the file to executable 2061 pbs_command=['qs tat-n CIVX '...2064 pbs_command=['qsub -n CIVX '... 2062 2065 '-t idempotent --checkpoint ' num2str(walltime_onejob+60) ' '... 2063 2066 '-l /core=' num2str(NbCore) ','... … … 2065 2068 '-E ' regexprep(filename_joblist,'\.txt\>','.stderr') ' '... 2066 2069 '-O ' regexprep(filename_joblist,'\.txt\>','.log') ' '... 2067 extra_ oar' '...2070 extra_qstat ' '... 2068 2071 '"oar-parexec -s -f ' filename_joblist ' '... 2069 2072 '-l ' filename_joblist '.log"']; … … 2075 2078 %system(pbs_command); 2076 2079 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 '.']) 2077 2139 case 'python' 2078 2140 command = [ … … 2356 2418 end 2357 2419 end 2420 else 2421 set(handles.FieldName,'Visible','off') 2358 2422 end 2359 2423 … … 2382 2446 end 2383 2447 if warn_coord 2384 msgbox_uvmat('WARNING','coordi ante 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') 2385 2449 end 2386 2450
Note: See TracChangeset
for help on using the changeset viewer.