Changeset 13012 for issm/trunk-jpl/src/m/classes/modellist.m
- Timestamp:
- 08/13/12 12:11:44 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/modellist.m
r13008 r13012 292 292 end 293 293 end 294 295 function BuildMultipleQueueingScript(cluster,name,executionpath,codepath)% {{{ 296 %BUILDMULTIPLEQUEUEINGSCRIPT - 297 % 298 % Usage: 299 % BuildMultipleQueueingScript(executionpath,codepath) 300 301 disp('building queueing script'); 302 303 %First try and figure out if there is a special script for this particular cluster 304 function_name=['BuildMultipleQueueingScript' cluster]; 305 306 %some specific treatment of identical cluster, gemini, castor and pollux 307 if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'), 308 function_name='BuildMultipleQueueingScriptgemini'; 309 end 310 311 if exist(function_name,'file'), 312 %Call this function: 313 eval([function_name '(name,executionpath,codepath);']); 314 else 315 %Call the generic BuildQueueingScript: 316 BuildMultipleQueueingScriptGeneric(name,executionpath,codepath); 317 end 318 end % }}} 319 function BuildQueueingScriptgemini(name,executionpath,codepath)% {{{ 320 %BUILDQUEUEINGSCRIPTGEMINI - ... 321 % 322 % Usage: 323 % BuildQueueingScriptgemini(md,executionpath,codepath) 324 325 scriptname=[name '.queue']; 326 327 fid=fopen(scriptname,'w'); 328 if fid==-1, 329 error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']); 330 end 331 332 fprintf(fid,'#!/bin/sh\n'); 333 fprintf(fid,'cd %s\n',executionpath); 334 fprintf(fid,'mkdir %s\n',name); 335 fprintf(fid,'cd %s\n',name); 336 fprintf(fid,'mv ../ModelList.tar.gz ./\n'); 337 fprintf(fid,'tar -zxvf ModelList.tar.gz\n'); 338 fprintf(fid,'foreach i (%s-*vs*.queue)\n',name); 339 fprintf(fid,'qsub $i\n'); 340 fprintf(fid,'end\n'); 341 fclose(fid); 342 end% }}} 343 function LaunchMultipleQueueJob(cluster,name,executionpath)% {{{ 344 %LAUNCHMULTIPLEQUEUEJOB - ... 345 % 346 % Usage: 347 % LaunchMultipleQueueJob(executionpath) 348 349 %First try and figure out if there is a special script for thie particular cluster 350 function_name=['LaunchMultipleQueueJob' cluster]; 351 352 %some specific treatment of identical cluster, gemini, castor and pollux 353 if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'), 354 function_name='LaunchMultipleQueueJobgemini'; 355 end 356 357 if exist(function_name,'file'), 358 %Call this function: 359 eval([function_name '(cluster,name,executionpath);']); 360 else 361 %Call the generic LaunchMultipleQueueJob: 362 LaunchMultipleQueueJobGeneric(cluster,name,executionpath); 363 end 364 end% }}} 365 function md=LaunchMultipleQueueJobgemini(cluster,name,executionpath)% {{{ 366 %LAUNCHMULTIPLEQUEUEJOBGEMINI - Launch multiple queueing script on Gemini cluster 367 % 368 % Usage: 369 % LaunchMultipleQueueJobgemini(cluster,name,executionpath) 370 371 372 %first, check we have the binary file and the queueing script 373 if ~exist([ name '.queue'],'file'), 374 error('LaunchMultipleQueueJobgemini error message: queueing script issing, cannot go forward'); 375 end 376 377 if ~exist('ModelList.tar.gz','file'), 378 error('LaunchMultipleQueueJobgemini error message: inputs models file missing, cannot go forward'); 379 end 380 381 %upload both files to cluster 382 disp('uploading input file, queueing script and variables script'); 383 eval(['!scp ModelList.tar.gz ' name '.queue ' cluster ':' executionpath]); 384 385 disp('launching solution sequence on remote cluster'); 386 issmssh(cluster,login,['"cd ' executionpath ' && source ' name '.queue "']); 387 end% }}}
Note:
See TracChangeset
for help on using the changeset viewer.