Thread Subject: waitForState

Subject: waitForState

From: Mr. CFD

Date: 19 May, 2009 06:40:18

Message: 1 of 1

Hi,
When running a job on a cluster, I have noticed that the 'waitForState' command does not perform as expected. When a function is submitted on a cluster, the simulations progress successfully and all the files/results are generated and saved as expected. However, MATLAB continues to display a 'busy' status, even though the tasks on the cluster have successfully completed. Strangely, rebooting MATLAB and running the task again works (i.e. MATLAB correctly outputs the solutions when the cluster is finished), however over time, the 'waitForState' command again fails. Can you please suggest what is happening?
====================================================
n=5;
clusterHost = 'xxx.xxx.xxx;
remoteDataLocation = '/matlab/';

% Create a job scheduler / manager object:
timeLimit = '00:04:00';
sched = findResource('scheduler', 'type', 'generic');

% Use a local directory as the DataLocation
set(sched, 'DataLocation', 'C:\MATLAB')

set(sched, 'ClusterMatlabRoot', '/matlab/R2008b');
set(sched, 'HasSharedFilesystem', true)
set(sched, 'ClusterOsType', 'unix');
set(sched, 'GetJobStateFcn', @pbsGetJobState);
set(sched, 'DestroyJobFcn', @pbsDestroyJob);

% For parallel job:
set(sched, 'ParallelSubmitFcn', {@pbsNonSharedParallelSubmitFcn, timeLimit, clusterHost, remoteDataLocation});
pjob = createMatlabPoolJob(sched)

set(pjob, 'FileDependencies', {my_func.m'})

% Create and submit the task, wait for results
createTask(pjob, @my_func, 1, {n});
set(pjob,'MinimumNumberOfWorkers',1);
set(pjob,'MaximumNumberOfWorkers',1);

submit(pjob)
waitForState(pjob, 'finished');

results = getAllOutputArguments(pjob)
% celldisp(results);

% Convert to matrices
% result1=results{1,1};

% Close job
destroy(pjob);

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com