LaunchQueueJobcosmos

PURPOSE ^

LAUNCHQUEUEJOBCOSMOS - ...

SYNOPSIS ^

function LaunchQueueJobcosmos(md,executionpath)

DESCRIPTION ^

LAUNCHQUEUEJOBCOSMOS - ...

   Usage:
      LaunchQueueJobcosmos(md,executionpath)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function LaunchQueueJobcosmos(md,executionpath)
0002 %LAUNCHQUEUEJOBCOSMOS - ...
0003 %
0004 %   Usage:
0005 %      LaunchQueueJobcosmos(md,executionpath)
0006 
0007 %first, check we have the binary file and the queueing script
0008 if ~exist([ md.name '.bin'],'file'),
0009     error('LaunchQueueJobcosmos error message: Binary input file missing, cannot go forward');
0010 end
0011 
0012 if ~exist([ md.name '.queue'],'file'),
0013     error('LaunchQueueJobcosmos error message: queueing script issing, cannot go forward');
0014 end
0015 
0016 %Some special handling here! We could not get lsf to work through ssh, there is always something going badly
0017 %in terms of environment variables not being correctly setup. This is due to the fact the ssh does not use a loging
0018 %shell! What we therefore did, is figure out every variable setup in a login shell ( you can find it out by typing
0019 %export in a login bash shell). Instead of trying to figure out which path variable is not being correctly setup,
0020 %we just dump the export command result into a file, which we source before launching our job. This ensures we replicate
0021 %exactly the state of a login shell, through ssh.
0022 cosmosvariableslocation=which('cosmosvariables.sh');
0023 if isempty(cosmosvariableslocation),
0024     error('LaunchQueueJobcosmos error message: could not find environment variables for cosmos cluster!');
0025 end
0026 
0027 %now upload both files to cluster
0028 disp('uploading input file,  queueing script and variables script');
0029 eval(['!scp ' md.name '.bin' ' ' md.name '.queue ' cosmosvariableslocation ' ' md.cluster ':' executionpath]);
0030 
0031 disp('launching solution sequence on remote cluster');
0032 %now call the queuing script to launch the job.
0033 system(['ssh  ' md.cluster ' ''cd ' executionpath ' && source ./cosmosvariables.sh && bsub <  ' md.name '.queue  && rm cosmosvariables.sh ''']);

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