icediagnostic_wrapper

PURPOSE ^

ICEDIAGNOSTIC_WRAPPER - wrapper of diagnostic solution

SYNOPSIS ^

function md=icediagnostic_wrapper(md);

DESCRIPTION ^

ICEDIAGNOSTIC_WRAPPER - wrapper of diagnostic solution

   diagnostic wrapper for diagnostic matlab driven solution. 
   we need a wrapper so that we can launch the diagnostic solution using Matlab parallel, 

   Usage:
      md=icediagnostic_wrapper(md)

   See also: ICEDIAGNOSTIC, ICEDIAGNOSTIC2D, ICEDIAGNOSTIC3D, ICEDIAGNOSTIC_CORE_NONLINEAR ICEDIAGNOSTIC_CORE_LINEAR

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function md=icediagnostic_wrapper(md);
0002 %ICEDIAGNOSTIC_WRAPPER - wrapper of diagnostic solution
0003 %
0004 %   diagnostic wrapper for diagnostic matlab driven solution.
0005 %   we need a wrapper so that we can launch the diagnostic solution using Matlab parallel,
0006 %
0007 %   Usage:
0008 %      md=icediagnostic_wrapper(md)
0009 %
0010 %   See also: ICEDIAGNOSTIC, ICEDIAGNOSTIC2D, ICEDIAGNOSTIC3D, ICEDIAGNOSTIC_CORE_NONLINEAR ICEDIAGNOSTIC_CORE_LINEAR
0011 
0012 %start timing
0013 t1=clock;
0014 
0015 %If running in parallel, launch core diagnostic routine within a parallel job.
0016 if strcmpi(md.cluster,'yes'),
0017     sched = findResource('scheduler', 'configuration', md.scheduler_configuration);
0018     pjob = createParallelJob(sched);
0019     set(pjob, 'FileDependencies', {'icediagnostic.m'});
0020     set(pjob, 'MaximumNumberOfWorkers', md.np); set(pjob, 'MinimumNumberOfWorkers', md.np);
0021     t = createTask(pjob, @icediagnostic, 1, {md});
0022     set(t, 'CaptureCommandWindowOutput', true)
0023     disp('   Submitting job to cluster');
0024     submit(pjob);
0025     waitForState(pjob);
0026     get(t, 'CommandWindowOutput')
0027     get(t,'ErrorMessage')
0028     disp('   Done running on cluster');
0029 else
0030     md=icediagnostic(md);
0031 end
0032 
0033 %stop timing
0034 t2=clock;
0035 
0036 disp(sprintf('\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']));

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