solveparallel

PURPOSE ^

SOLVEPARALLEL - solution sequence using a cluster in parallel mode

SYNOPSIS ^

function md=solveparallel(md,solutiontype,varargin)

DESCRIPTION ^

SOLVEPARALLEL - solution sequence using a cluster in parallel mode

   Usage:
      md=solveparallel(md,solutiontype,varargin)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function md=solveparallel(md,solutiontype,varargin)
0002 %SOLVEPARALLEL - solution sequence using a cluster in parallel mode
0003 %
0004 %   Usage:
0005 %      md=solveparallel(md,solutiontype,varargin)
0006 
0007 %Recover type of package being used:
0008 if nargin==2,
0009     package='Ice';
0010 else
0011     package=varargin{1};
0012 end
0013 
0014 if ~ischar(package), 
0015     error('Package specified in varargin can only be ''ice'', or ''cielo''');
0016 end
0017 
0018 if ~(strcmpi(package,'ice') || strcmpi(package,'cielo') || strcmpi(package,'macayeal'))
0019     error('Package specified in varargin can only be ''ice'', ''macayeal'', or ''cielo''');
0020 end
0021 
0022 %Get cielo.rc location
0023 cielo_rc_location=which('cielo.rc');
0024 
0025 %Figure out parameters for this particular cluster
0026 [codepath,executionpath]=ProcessParallelParametersFromCieloRc(md.cluster,cielo_rc_location);
0027 
0028 %Marshall model data into a binary file.
0029 marshall(md,solutiontype,package);
0030 
0031 %Now, we need to build the queuing script, used by the cluster to launch the job.
0032 BuildQueueingScript(md,solutiontype,executionpath,codepath);
0033 
0034 %Now, launch the queueing script
0035 LaunchQueueJob(md,executionpath);
0036 
0037 %Do we return, or just wait for results?
0038 if md.waitonlock,
0039     %we wait for the done file
0040     waitonlock([executionpath '/' md.name '.lock']);
0041     %load results
0042     md=loadresultsfromcluster(md,solutiontype);
0043 else
0044     return;
0045 end

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