Error using matlabpool - Undefined function 'distcomp.fileserializer'

前端 未结 1 1743
陌清茗
陌清茗 2021-01-18 04:30

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<

相关标签:
1条回答
  • 2021-01-18 04:43

    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:

    1. Go to the following website that describes this bug fix: http://www.mathworks.com/support/bugreports/919688

    2. 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

    3. Open up MATLAB, and in the Command Prompt, type the following in: cd (matlabroot) and push ENTER or RETURN.

    4. 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

    5. Now, close MATLAB.

    6. 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.

    7. 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.

    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
    9. 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.

    10. Restart MATLAB. This should fix this error, and it worked for me.

    0 讨论(0)
提交回复
热议问题