LaunchQueueJobGeneric

PURPOSE ^

LAUNCHQUEUEJOBGENERIC - ...

SYNOPSIS ^

function LaunchQueueJobGeneric(md,executionpath)

DESCRIPTION ^

LAUNCHQUEUEJOBGENERIC - ...

   Usage:
      LaunchQueueJobGeneric(md,executionpath)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function LaunchQueueJobGeneric(md,executionpath)
0002 %LAUNCHQUEUEJOBGENERIC - ...
0003 %
0004 %   Usage:
0005 %      LaunchQueueJobGeneric(md,executionpath)
0006 
0007 %first, check we have the binary file and the queueing script
0008 if ~exist([ md.name '.bin'],'file'),
0009     error('LaunchQueueJobGeneric error message: Binary input file missing, cannot go forward');
0010 end
0011 
0012 if ~exist([ md.name '.queue'],'file'),
0013     error('LaunchQueueJobGeneric error message: queueing script issing, cannot go forward');
0014 end
0015 
0016 %if we are running locally, no need to call ssh to launch the job. We figure out by comparing the
0017 %hostname to the cluster name
0018 [result,hostname]=system('hostname -s');hostname=hostname(1:end-1);
0019     
0020 disp('uploading input file and queueing script');
0021 if strcmpi(hostname,md.cluster),
0022     system(['cp ' md.name '.bin' ' ' md.name '.queue' ' ' executionpath]);
0023 else
0024     system(['scp ' md.name '.bin' ' ' md.name '.queue' ' ' md.cluster ':' executionpath]);
0025 end
0026 
0027 disp('launching solution sequence on remote cluster');
0028 %now call the queuing script to launch the job.
0029 if strcmpi(hostname,md.cluster),
0030     system(['cd ' executionpath ' && source ' md.name '.queue ']);
0031 else
0032     system(['ssh  ' md.cluster ' ''cd ' executionpath ' && source ' md.name '.queue ''']);
0033 end

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003