I am trying to use the Parallel Computing Toolbox in MATLAB to help speed up some intensive computation that I am performing. Before I can use constructs like parfor<
Thanks to @RTL in his comments above, he discovered that this is a bug that was introduced after updating your Java version to 1.6.0_39 or later. The thread for this can be found here. Running any Parallel Computing Toolbox code using any version of Java that is at least this or later may cause a NullPointerException
to be thrown. The distcomp.fileserializer
error is among the errors here.
As such, there was a bug fix posted in the thread I referenced above where several files in MATLAB have to be updated. Here are the steps that I followed to resolve this error:
Go to the following website that describes this bug fix: http://www.mathworks.com/support/bugreports/919688
There are .zip
files available that contain the necessary files you need to overwrite in MATLAB. Each kind of .zip
file pertains to the version of MATLAB you are using. Make sure you download the correct .zip
file that corresponds to your version of MATLAB. There is a poster in the above thread that I consulted that claimed that those files broke his/her MATLAB and so they needed to reinstall. This did not happen to me.
As I am running MATLAB R2013a, this is the link to the .zip
file that I downloaded: http://www.mathworks.com/support/bugreports/license/accept_license/5383?fname=attachment_919688_12b_13a_2013-03-08.zip&geck_id=919688
Open up MATLAB, and in the Command Prompt, type the following in: cd (matlabroot)
and push ENTER or RETURN.
In the GUI where you see the Current Folder subwindow, right click anywhere in this area, then click on Open Current Folder in Finder. This will open up where MATLAB is located on your system in the Finder. In my case, my MATLAB is found here: /Applications/MATLAB_R2013a.app
Now, close MATLAB.
Unzip the contents of the .zip
file that was downloaded. You will see that there are three folders within the unzipped archive: bugreport
, java
, and toolbox
. You just need to worry about java
and toolbox
.
What you need to do is simply replace the contents of the java
and toolbox
folders with the unzipped archive with the same java
and toolbox
folders found on MATLAB from Step #4. Before you do that, go to Step #8.
It is highly recommended that you save a copy of what you are going to overwrite before you do this. I simply renamed the files and folders that I was going to overwrite with the suffix old
so that I can revert back to them if necessary. For your consideration, these are the files and folders that need to be replaced using the .zip
file:
java/jarext/distcomp/jiini2/
toolbox/distcomp/private/initcommon.m
Now that you have backed up these files, take the contents of the .zip
file and overwrite those in your MATLAB program in the folder you found using Step #4.
Restart MATLAB. This should fix this error, and it worked for me.