0001 function md=icediagnostic_wrapper(md);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 t1=clock;
0014
0015
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
0034 t2=clock;
0035
0036 disp(sprintf('\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']));