Changeset 20120
- Timestamp:
- 02/11/16 14:55:01 (9 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/clusters/generic.m
r19958 r20120 155 155 end 156 156 %}}} 157 function BuildQueueScriptMultipleModels(cluster,dirname,modelname,solution,dirnames,modelnames,nps) % {{{ 158 159 %some checks: 160 if isempty(modelname), error('BuildQueueScriptMultipleModels error message: need a non empty model name!');end 161 162 %what is the executable being called? 163 executable='issm_slr.exe'; 164 165 if ispc(), error('BuildQueueScriptMultipleModels not support yet on windows machines');end; 166 167 %write queuing script 168 fid=fopen([modelname '.queue'],'w'); 169 170 fprintf(fid,'#!%s\n',cluster.shell); 171 172 %number of cpus: 173 mpistring=sprintf('mpiexec -np %i ',cluster.np); 174 175 %executable: 176 mpistring=[mpistring sprintf('%s/%s ',cluster.codepath,executable)]; 177 178 %solution name: 179 mpistring=[mpistring sprintf('%s ',EnumToString(solution))]; 180 181 %execution directory and model name: 182 mpistring=[mpistring sprintf('%s/%s %s',cluster.executionpath,dirname,modelname)]; 183 184 %inform main executable of how many icecaps, glaciers and earth models are being run: 185 mpistring=[mpistring sprintf(' %i ',length(dirnames))]; 186 187 %icecaps, glaciers and earth location, names and number of processors associated: 188 for i=1:length(dirnames), 189 mpistring=[mpistring sprintf(' %s/%s %s %i ',cluster.executionpath,dirnames{i},modelnames{i},nps{i})]; 190 end 191 192 %log files: 193 if ~cluster.interactive, 194 mpistring=[mpistring sprintf('2> %s.errlog> %s.outlog',modelname,modelname)]; 195 end 196 197 %write this long string to disk: 198 fprintf(fid,mpistring); 199 fclose(fid); 200 201 %in interactive mode, create a run file, and errlog and outlog file 202 if cluster.interactive, 203 fid=fopen([modelname '.errlog'],'w'); fclose(fid); 204 fid=fopen([modelname '.outlog'],'w'); fclose(fid); 205 end 206 end 207 %}}} 157 208 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{ 158 209 … … 219 270 end 220 271 end %}}} 221 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart )% {{{272 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{ 222 273 223 274 if ~ispc, … … 235 286 launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && cd ' dirname ' && source ' modelname '.queue ']; 236 287 else 288 if ~batch, 237 289 launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ... 238 290 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz && source ' modelname '.queue ']; 291 else 292 launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ... 293 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz ']; 294 end 239 295 end 240 296 issmssh(cluster.name,cluster.login,cluster.port,launchcommand); -
issm/trunk-jpl/src/m/classes/clusters/generic.py
r19674 r20120 183 183 184 184 # }}} 185 def LaunchQueueJob(self,modelname,dirname,filelist,restart ): # {{{185 def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch): # {{{ 186 186 187 187 print 'launching solution sequence on remote cluster' … … 189 189 launchcommand='cd %s && cd %s chmod 777 %s.queue && ./%s.queue' % (self.executionpath,dirname,modelname,modelname) 190 190 else: 191 launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz && chmod 777 %s.queue && ./%s.queue' % \ 191 if batch: 192 launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz && chmod 777 %s.queue && ./%s.queue' % \ 192 193 (self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname,modelname) 194 else: 195 launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz' % \ 196 (self.executionpath,dirname,dirname,dirname,dirname,dirname) 197 193 198 issmssh(self.name,self.login,self.port,launchcommand) 194 199 # }}} -
issm/trunk-jpl/src/m/classes/clusters/pfe.m
r20042 r20120 308 308 end 309 309 %}}} 310 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart )% {{{310 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{ 311 311 312 312 %lauch command, to be executed via ssh -
issm/trunk-jpl/src/m/classes/clusters/pfe.py
r19674 r20120 180 180 181 181 # }}} 182 def LaunchQueueJob(self,modelname,dirname,filelist,restart ):182 def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch): 183 183 # {{{ 184 184 -
issm/trunk-jpl/src/m/solve/solve.m
r19638 r20120 36 36 md.private.solution=solutionenum; 37 37 cluster=md.cluster; 38 if strcmpi(getfieldvalue(options,'batch','no'),'yes') batch=1; else batch=0; end 38 39 39 40 %check model consistency … … 99 100 BuildQueueScript(cluster,md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof,md.qmu.isdakota); % queue file 100 101 101 %Stop here if batch mode102 if strcmpi(getfieldvalue(options,'batch','no'),'yes')103 if md.verbose.solution,104 disp('batch mode requested: not launching job interactively');105 disp('launch solution sequence on remote cluster by hand');106 end107 return;108 end109 110 102 %Upload all required files 111 103 modelname = md.miscellaneous.name; … … 126 118 127 119 %launch queue job: 128 LaunchQueueJob(cluster,md.miscellaneous.name,md.private.runtimename,filelist,restart );120 LaunchQueueJob(cluster,md.miscellaneous.name,md.private.runtimename,filelist,restart,batch); 129 121 122 %return if batch: 123 if batch, 124 if md.verbose.solution, 125 disp('batch mode requested: not launching job interactively'); 126 disp('launch solution sequence on remote cluster by hand'); 127 end 128 return; 129 end 130 130 %wait on lock 131 131 if isnan(md.settings.waitonlock), -
issm/trunk-jpl/src/m/solve/solve.py
r19638 r20120 47 47 #recover some fields 48 48 md.private.solution=solutionenum 49 cluster=md.cluster 49 cluster=md.cluster 50 if m.strcmpi(options.getfieldvalue('batch','no'),'yes'): 51 batch=1 52 else: 53 batch=0; 50 54 51 55 #check model consistency … … 113 117 114 118 #Launch job 115 cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist,restart )119 cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist,restart,batch) 116 120 117 121 #wait on lock
Note:
See TracChangeset
for help on using the changeset viewer.