JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for SPM Archives


SPM Archives

SPM Archives


SPM@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

SPM Home

SPM Home

SPM  April 2017

SPM April 2017

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: SPM on Matlab Parallel Pool, error in list.m: 'Undefined function list for input arguments of type cell.'

From:

Guillaume Flandin <[log in to unmask]>

Reply-To:

Guillaume Flandin <[log in to unmask]>

Date:

Mon, 24 Apr 2017 10:55:41 +0100

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (182 lines)

Dear Jessica,

I got at times a similar error and I'm still unclear about when it
happens and why. With local workers, code shouldn't have to be copied
around but it seems it is:
>> Analyzing and transferring files to the workers...done.
and, unsurprisingly, MATLAB fails at finding all the dependencies in the
SPM code and the transferred local copies of SPM are unusable.
In my case, it was not working when the equivalent of your
LBCN_montage.m file was a function, but it was working fine when it was
a script. Do you see the same thing?
If someone else has been delving into this, I'd be curious to hear about
their findings.

Best regards,
Guillaume.


On 21/04/17 17:15, jschrouf wrote:
> Dear All,
> 
> I am getting a similar error as reported below when trying to run SPM in
> a parfor loop (which contains a succession of matlab batches, home built
> functions and calls to spm routines):
> 
> Error using cfg_repeat/list (line 112)
> An UndefinedFunction error was thrown on the workers for 'list'.  This
> might be
> because the file containing 'list' is not accessible on the workers.  Use
> addAttachedFiles(pool, files) to specify the required files to be
> attached.  See
> the documentation for 'parallel.Pool/addAttachedFiles' for more details.
> 
> Error in cfg_util>local_getcjid2subs (line 1352)
> cjid2subsin = list(cjin, exspec, tropts);
> 
> Error in cfg_util>local_initjob (line 1537)
> [ucj, ucjid2subs] = cellfun(@local_getcjid2subs, ucj, 'UniformOutput',
> false);
> 
> Error in cfg_util (line 802)
>                 [jobs(cjob), mod_job_idlist] = local_initjob(jobs(cjob),
> job,
>                 jobdedup);
> 
> Error in spm_jobman (line 246)
>         cjob = cfg_util('initjob', mljob);
> 
> Error in LBCN_montage (line 97)
>     [out] = spm_jobman('run', jobfile,input_array{:});
> 
> Caused by:
>     Undefined function 'list' for input arguments of type 'cell'.
> 
> There are a lot of warnings issued as well, including 'Multiple versions
> of FieldTrip' (I only have the SPM release), 'Can't obtain SPM revision
> information' or Warning: Name is nonexistent or not a directory:
> C:\Users\PARVIZ~1\AppData\Local\Temp\tp8072edf9_f75f_4d55_bb66_0c72af7d62b8rp8020\a\tp7f37736c_aeeb_4493_bb36_dc729ef44248\toolbox\MEEGtools
>> In path (line 109)
>   In addpath (line 88)
>   In spm (line 434)
>   In LBCN_montage (line 92)
>   In parallel_function>make_general_channel/channel_general (line 929)
>   In remoteParallelFunction (line 38)
> Item matlabbatch: No repeat named
> spm
> 
> Can you please advise?
> 
> Thank you!
> 
> Best regards,
> 
> Jessica
> 
> 
> On 6/16/2016 10:30 AM, Katie Surrence wrote:
>> Dear SPM experts,
>>
>> I am attempting to run SPM, specifically first level estimation, on
>> Matlab Parallel Pool, with little success.  
>>
>> The first errors I get are 'undefined function' errors.  They all
>> reference functions defined in one of the @cfg_ directories under the
>> matlabbatch directory.  I use the addAttachedFiles method of the
>> parallel pool to make these files available to the remote workers,
>> although in some cases there is more than one version of these files
>> available, and I have to guess at the correct one, which who knows,
>> may be part of my problem.  Eventually I stop getting 'undefined
>> function' errors and start getting an error that indicates a variable
>> is not of the type Matlab/SPM expects it to be.  This is very
>> challenging to look into without access to the debugger (since these
>> errors only occur on the remote workers, where I can't debug -- the
>> scripts run fine locally).  
>>
>> Here is the stack trace for the error I'm getting.
>>
>>     ks_main_3
>>     Item matlabbatch: No repeat named
>>     spm
>>     Error using list (line 103)
>>     Struct contents reference from a non-struct array object.
>>
>>     Error in cfg_repeat/list (line 112)
>>
>>     Error in cfg_util>local_getcjid2subs (line 1352)
>>
>>     Error in cfg_util>local_initjob (line 1537)
>>
>>     Error in cfg_util (line 802)
>>
>>     Error in spm_jobman (line 245)
>>
>>     Error in ks_conds_estimate_func (line 37)
>>     parfor nsub = 1:length(subjects)
>>
>>     Error in ks_main_3 (line 151)
>>     ks_conds_estimate_func(Data, Time)
>>
>> Here are lines 99 to 103 of the version of list.m I attached to the
>> parallel pool:
>>
>>     if (isempty(tropts.stopspec) || ~match(item, tropts.stopspec)) &&
>>     (tropts.cnt < tropts.mcnt) && (tropts.clvl < tropts.mlvl)
>>
>>         tname = treepart(item, tropts.dflag);
>>
>>         % subscripts to child nodes
>>
>>         idsubs = substruct('.', tname, '{}', {});
>>
>>         citems = subsref(item, idsubs(1));
>>
>> It's that last line that causes the error.  Even though I can't use
>> the debugger, I tried adding some disp statements to list.m to see
>> what the values of item and idsubs were just before the error.  I get
>> an empty line for item.  For idsubs, Matlab reports that it's a 1x2
>> _struct_ array with fields 
>>
>> type
>>
>> subs
>>
>> I also had it display idsubs(1) and matlab gives
>>
>> type: '.'
>>
>> subs: 'val'
>>
>> So, according to Matlab, idsubs *is* a struct, so it shouldn't be
>> causing the error.  I thought for a second that maybe somehow item,
>> being empty, was at fault, and subsref.m expected a struct, but if
>> that were so I would assume the trace would include a call to subsref.  
>>
>> I would love to be able to run on the cluster and complete first
>> levels faster, but this is extremely daunting.  I would appreciate any
>> insight into this problem that you may have, or suggestions for other
>> approaches (like a complete remote SPM installation?  I'm not sure how
>> that would work).  
>>
>> I'm attaching the main script I run, the function it calls that
>> populates matlabbatch for the estimation, and the versions of list.m,
>> match.m, and treeparts.m I attach to the parallel pool, in case they
>> are helpful for understanding the problem.
>>
>> Thanks very much in advance.
>>
>> Best,
>>
>> Katie
>>
>>
>>
> 

-- 
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager