Path: news.mathworks.com!not-for-mail
From: Edric M Ellis <eellis@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Creating and Running Jobs with a Local Scheduler
Date: 11 Nov 2008 11:10:23 +0000
Organization: The Mathworks, Ltd.
Lines: 87
Sender: eellis@uk-eellis-deb4-64.mathworks.co.uk
Message-ID: <ytwtzaey0v4.fsf@uk-eellis-deb4-64.mathworks.co.uk>
References: <gcl2cg$nh$1@fred.mathworks.com> <ytwd4i9hlyy.fsf@uk-eellis-deb4-64.mathworks.co.uk> <gcmk0j$56o$1@fred.mathworks.com> <gcmmm9$p98$1@fred.mathworks.com> <ytwprm9q65w.fsf@uk-eellis-deb4-64.mathworks.co.uk> <gcn420$s4u$1@fred.mathworks.com> <ytwljwwresa.fsf@uk-eellis-deb4-64.mathworks.co.uk> <gcp9bu$3qo$1@fred.mathworks.com> <ytwd4i5q7oz.fsf@uk-eellis-deb4-64.mathworks.co.uk> <gfbgil$ert$1@fred.mathworks.com>
NNTP-Posting-Host: uk-eellis-deb4-64.mathworks.co.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: fred.mathworks.com 1226401823 4747 172.16.27.111 (11 Nov 2008 11:10:23 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 11 Nov 2008 11:10:23 +0000 (UTC)
X-Face: $Ahg}Iylezql"r1WV1Me5&)ng"a4v%D>==KMs-elCfj"o}$bh-VOt7lVXgLWsC?9mZ`mINT
 G6PDvca;nrgs$lfcr0l1ew'N]>nXKl}m|Zpg>,6*gLp~-N0N2*+b.iwv=u>@R$L4SEG&NYUU;lSR@u
 IHphdAy
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4
Xref: news.mathworks.com comp.soft-sys.matlab:500179


"Mr. CFD" <s2108860@student.rmit.edu.au> writes:

> Well we have finally got R2008b on the clusters and the simple (@rand)
> tutorial provided in the help file works fine,when submitting it to the
> cluster, unlike before when the two MATLAB versions were different.
>
> Now I am trying to feed in my own function and have it submitted to the
> cluster. Have a very simple test.m model as below
>
> =====================================================
> function result=test(x)
> y = x+2 ;
> result = {y};
> =======================================================
> Using the following submit functions:
> 
> clusterHost = 'xxx.xxx.xxx'; [...]
> 
> j = createJob(sched)
> createTask(j, @test, 1, {{1}  {3}});
> submit(j)

I suspect that the problem is that your cluster cannot find "test.m", you should
add that to the FileDependencies of the job, like so:

j.FileDependencies = {'test.m'};

(This is not needed for "rand" since that's already on the MATLAB path of the
workers.)

> The clusters report no errors, but MATLAB window continues to display an
> 'Empty cell array: 1-by-0' for the results output.  

When you say "The clusters report no errors" - where are you looking? Did you
try displaying the job (simply type the job name with no semicolon)? That might
indicate problems. Here's what I see if I try to run a job which doesn't have
correct FileDependencies:

>> j = jm.createJob(); j.createTask( @test, 1, {{1}, {3}} );
>> j.submit(); j.wait();
>> j

j =

Job ID 2 Information
====================

                  UserName : eellis
                     State : finished
                SubmitTime : Tue Nov 11 10:56:30 GMT 2008
                 StartTime : Tue Nov 11 10:56:30 GMT 2008
          Running Duration : 0 days 0h 0m 2s

- Data Dependencies

          FileDependencies : {}
          PathDependencies : {}

- Associated Task(s)

           Number Pending  : 0
           Number Running  : 0
           Number Finished : 2
          TaskID of errors : [1  2]

>> j.Tasks(1)
ans =

Task ID 1 from Job ID 4 Information
===================================

                     State : finished
                  Function : @test
                 StartTime : Tue Nov 11 10:56:30 GMT 2008
          Running Duration : 0 days 0h 0m 1s

- Task Result Properties

           ErrorIdentifier : MATLAB:UndefinedFunction
              ErrorMessage : Undefined function or method 'test' for input...
                           : s of type 'double'.
               Error Stack :


Cheers,

Edric.