Hi, thanks for the additional information.
I believe that we are dealing with a version issue now. Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme'). It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')? Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $ Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $ Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues. As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is - to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command. Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations. All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0. Let us know if I am mistaken or if there are further issues. Best regards, Kersten -----Original Message----- From: "Kaushal, Mayank" <mkaus...@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100 Thanks for the quick response Kersten. I tried all the potential suggestions mentioned in your post but still no luck. Here’s the summary: lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'. Error in lme_mass_fit (line 124) if (matlabpool('size') > 0) Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e); lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'. Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs) Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e); The "automatically create a parallel pool" was already deselected in my case. Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website. Mayank > > On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. > de> wrote: > > ATTENTION: This email originated from a sender outside of MCW. Use > caution when clicking on links or opening attachments. > ________________________________ > > Hi, > > you might try supplying an additional command-line argument while > calling the 'lme_mass_fit_vw' function: > > lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) > > This will tell Matlab to use only one worker. Further documentation > on > this additional argument can be obtained by typing 'help > lme_mass_fit_vw' at the Matlab prompt. > > To get this working with my Matlab installation, I additionally had > to deselect the "Automatically create parallel pool (if one doesn't > already exist) when parallel keywords (e.g., parfor) are executed." > option. This can be found in Matlab's preferences menu (--> see the > Parallel Computing toolbox section). > > As an alternative, using two workers might also be an option in your > case: > > lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) > > To get this alternative approach working, I did not have to change > the > Matlab preferences. > > Hope this helps, > > Kersten > > > -----Original Message----- > From: "Kaushal, Mayank" <mkaus...@mcw.edu> > Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu> > To: freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.edu> > Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model > Date: Sun, 4 Mar 2018 23:56:03 +0100 > > Dear Freesurfer Community, > > Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the > following error, > Starting parallel pool (parpool) using the 'local' profile ... > Error using parpool (line 104) > You requested a minimum of 8 workers, but the cluster "local" has the > NumWorkers property set to allow a maximum of 2 workers. To run a > communicating job on more workers than this (up to a maximum of 512 > for > the Local cluster), increase the value of the NumWorkers > property for the cluster. The default value of NumWorkers for a Local > cluster is the number of cores on the local machine. > > Error in lme_mass_fit (line 137) > parpool(prs); > > Error in lme_mass_fit_vw (line 73) > [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e); > > I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, > 8 > GB 1600 MHz DDR3. > > I have researched the forum on how to stop the function from trying > to > initiate parallel processing but so far haven’t been able figure out > how to overcome this. > > Any help would be much appreciated. > > > Mayank Kaushal MD MBA > Postdoctoral Fellow > Department of Neurosurgery > Medical College of Wisconsin > > > > _______________________________________________ > Freesurfer mailing list > Freesurfer@nmr.mgh.harvard.edu > https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har > vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV > 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- > cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- > 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e= > > > The information in this e-mail is intended only for the person to > whom > it is > addressed. If you believe this e-mail was sent to you in error and > the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ > complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y > &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- > cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- > EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you > in error > but does not contain patient information, please contact the sender > and > properly > dispose of the e-mail. > > _______________________________________________ > Freesurfer mailing list > Freesurfer@nmr.mgh.harvard.edu > https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har > vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV > 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- > cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- > 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer