Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r465 r467 24 24 %TODO: search range 25 25 26 % Last Modified by GUIDE v2.5 03-Jun-2012 22:16:4226 % Last Modified by GUIDE v2.5 21-Jun-2012 20:22:39 27 27 % Begin initialization code - DO NOT EDIT 28 28 gui_Singleton = 1; … … 77 77 test_batch=strcmp(sparam.BatchParam.BatchMode,'sge'); %sge is currently the only implemented batch mod 78 78 end 79 RUNVal=get(handles.RunMode,'Value'); 79 80 if test_batch==0 80 set(handles.BATCH,'Enable','off')% put the BATCH button in grey (unactivated) 81 set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784])% put the BATCH button in grey (unactivated) 81 if RUNVal>2 82 set(handles.RunMode,'Value',1) 83 end 84 set(handles.RunMode,'String',{'local';'background'}) 85 else 86 set(handles.RunMode,'String',{'local';'background';'cluster'}) 87 % set(handles.BATCH,'Enable','off')% put the BATCH button in grey (unactivated) 88 % set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784])% put the BATCH button in grey (unactivated) 82 89 end 83 90 if isfield(sparam.RunParam,'CivBin') … … 804 811 set(handles.RUN, 'Enable','Off') 805 812 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) 806 batch=0; 813 batch=get(handles.RunMode,'Value'); 814 % batch=0; 807 815 errormsg=launch_jobs(hObject, eventdata, handles,batch); 808 816 set(handles.RUN, 'Enable','On') … … 817 825 status_Callback(hObject, eventdata, handles) 818 826 end 819 820 % ------------------------------------------------------------------------821 % --- Executes on button press in BATCH: remote processing822 function BATCH_Callback(hObject, eventdata, handles)823 % -----------------------------------------------------------------------824 set(handles.BATCH, 'Enable','Off')825 set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784])826 batch=1;827 errormsg=launch_jobs(hObject, eventdata, handles, batch);828 set(handles.BATCH, 'Enable','On')829 set(handles.BATCH,'BackgroundColor',[1 0 0])830 831 % display errors or start status callback to visualise results832 if ~isempty(errormsg)833 display(errormsg)834 msgbox_uvmat('ERROR',errormsg)835 elseif isfield(handles,'status')836 set(handles.status,'Value',1);%suppress status display837 status_Callback(hObject, eventdata, handles)838 end827 % 828 % %------------------------------------------------------------------------ 829 % % --- Executes on button press in BATCH: remote processing 830 % function BATCH_Callback(hObject, eventdata, handles) 831 % % ----------------------------------------------------------------------- 832 % set(handles.BATCH, 'Enable','Off') 833 % set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784]) 834 % batch=1; 835 % errormsg=launch_jobs(hObject, eventdata, handles, batch); 836 % set(handles.BATCH, 'Enable','On') 837 % set(handles.BATCH,'BackgroundColor',[1 0 0]) 838 % 839 % % display errors or start status callback to visualise results 840 % if ~isempty(errormsg) 841 % display(errormsg) 842 % msgbox_uvmat('ERROR',errormsg) 843 % elseif isfield(handles,'status') 844 % set(handles.status,'Value',1);%suppress status display 845 % status_Callback(hObject, eventdata, handles) 846 % end 839 847 840 848 %------------------------------------------------------------------- … … 1090 1098 end 1091 1099 test_interp=0; %eviter les variables test_ (LG) 1092 if batch 1100 if batch==3 %computation dispatched on a cluster 1093 1101 if isfield(s,'BatchParam') 1094 1102 Param.xml=s.BatchParam; … … 1114 1122 1115 1123 %% check batch mode supported 1116 if batch 1124 if batch==3 %computation dispatched on a cluster 1117 1125 switch batch_mode 1118 1126 case 'sge' … … 1187 1195 1188 1196 %% create subfolders for log, cmx, nml, xml, bat 1189 RootBat=fileparts(filecell.nc.civ1{1,1}) 1190 dir_list={'0_BAT','0_CMX','0_XML','0_LOG' ,}1197 RootBat=fileparts(filecell.nc.civ1{1,1}); 1198 dir_list={'0_BAT','0_CMX','0_XML','0_LOG'}; 1191 1199 for k=1:length(dir_list) 1192 1200 if ~exist(fullfile(RootBat,dir_list{k}),'dir') … … 1396 1404 %% start calculation 1397 1405 1398 if batch 1406 if batch ==3 1399 1407 switch batch_mode 1400 1408 case 'sge' %at the moment only psmn ENS Lyon uses it … … 1540 1548 return 1541 1549 end 1550 1551 fprintf(fid,['#!/bin/bash \n' ... 1552 '/etc/sysprofile \n'... 1553 'matlab -nodisplay -nosplash -nojvm <<END_MATLAB \n']); 1554 1555 1542 1556 fprintf(fid,['addpath(''' path_civ ''');\n']); 1543 1557 for p=1:length(batch_file_list) … … 1550 1564 1551 1565 end 1566 fprintf(fid, 'exit \n END_MATLAB \n'); 1567 1552 1568 fclose(fid); 1553 eval(['run ' filename_superbat]); 1569 eval(['run ' filename_superbat]); 1570 1554 1571 else 1555 1572 for p=1:length(batch_file_list) … … 4374 4391 4375 4392 if isequal(Param.CivMode,'Matlab') 4376 if batch 4393 if batch>1 4377 4394 cmd=['#!/bin/bash \n '... 4378 4395 '#$ -cwd \n '... … … 4573 4590 4574 4591 4575 4592 % --- Executes on selection change in RunMode. 4593 function RunMode_Callback(hObject, eventdata, handles)
Note: See TracChangeset
for help on using the changeset viewer.