Ignore:
Timestamp:
08/13/12 12:11:44 (13 years ago)
Author:
Mathieu Morlighem
Message:

CHG: moving stuff around

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/modellist.m

    r13008 r13012  
    292292        end
    293293end
     294
     295function BuildMultipleQueueingScript(cluster,name,executionpath,codepath)% {{{
     296%BUILDMULTIPLEQUEUEINGSCRIPT -
     297%
     298%   Usage:
     299%      BuildMultipleQueueingScript(executionpath,codepath)
     300
     301disp('building queueing script');
     302
     303%First try and figure out if there is a special script for this particular cluster
     304function_name=['BuildMultipleQueueingScript' cluster];
     305
     306%some specific treatment of identical cluster, gemini, castor and pollux
     307if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
     308        function_name='BuildMultipleQueueingScriptgemini';
     309end
     310
     311if exist(function_name,'file'),
     312        %Call this function:
     313        eval([function_name '(name,executionpath,codepath);']);
     314else
     315        %Call the generic BuildQueueingScript:
     316        BuildMultipleQueueingScriptGeneric(name,executionpath,codepath);
     317end
     318end % }}}
     319function BuildQueueingScriptgemini(name,executionpath,codepath)% {{{
     320%BUILDQUEUEINGSCRIPTGEMINI - ...
     321%
     322%   Usage:
     323%      BuildQueueingScriptgemini(md,executionpath,codepath)
     324
     325scriptname=[name '.queue'];
     326
     327fid=fopen(scriptname,'w');
     328if fid==-1,
     329        error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']);
     330end
     331
     332fprintf(fid,'#!/bin/sh\n');
     333fprintf(fid,'cd %s\n',executionpath);
     334fprintf(fid,'mkdir %s\n',name);
     335fprintf(fid,'cd %s\n',name);
     336fprintf(fid,'mv ../ModelList.tar.gz ./\n');
     337fprintf(fid,'tar -zxvf ModelList.tar.gz\n');
     338fprintf(fid,'foreach i (%s-*vs*.queue)\n',name);
     339fprintf(fid,'qsub $i\n');
     340fprintf(fid,'end\n');
     341fclose(fid);
     342end% }}}
     343function 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
     350function_name=['LaunchMultipleQueueJob' cluster];
     351
     352%some specific treatment of identical cluster, gemini, castor and pollux
     353if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
     354        function_name='LaunchMultipleQueueJobgemini';
     355end
     356
     357if exist(function_name,'file'),
     358        %Call this function:
     359        eval([function_name '(cluster,name,executionpath);']);
     360else
     361        %Call the generic LaunchMultipleQueueJob:
     362        LaunchMultipleQueueJobGeneric(cluster,name,executionpath);
     363end
     364end% }}}
     365function 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
     373if ~exist([ name '.queue'],'file'),
     374        error('LaunchMultipleQueueJobgemini error message: queueing script issing, cannot go forward');
     375end
     376
     377if ~exist('ModelList.tar.gz','file'),
     378        error('LaunchMultipleQueueJobgemini error message: inputs models file missing, cannot go forward');
     379end
     380
     381%upload both files to cluster
     382disp('uploading input file,  queueing script and variables script');
     383eval(['!scp ModelList.tar.gz ' name '.queue '  cluster ':' executionpath]);
     384
     385disp('launching solution sequence on remote cluster');
     386issmssh(cluster,login,['"cd ' executionpath ' && source ' name '.queue "']);
     387end% }}}
Note: See TracChangeset for help on using the changeset viewer.