使用Matlabpool时出错-未定义函数'distcomp.fileserializer' [英] Error using matlabpool - Undefined function 'distcomp.fileserializer'

查看:608
本文介绍了使用Matlabpool时出错-未定义函数'distcomp.fileserializer'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用MATLAB中的Parallel Computing Toolbox来帮助加快我正在执行的密集计算.在使用parfor之类的构造之前,我需要通过matlabpool创建一个工作池.首先,我只想使用默认的/local配置文件,只需本身调用matlabpool而不使用其他参数即可.但是,当我这样做时,会收到以下错误消息:

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, I need to create a pool of workers via matlabpool. To start, I simply want to use the default / local profile by just invoking matlabpool by itself with no additional parameters. However, when I do that, I get the following error message:

>> matlabpool
Starting matlabpool using the 'local' profile ... 
Error using matlabpool (line 134)
Undefined function 'distcomp.fileserializer' for input arguments of type
'distcomp.filestorage'.

我正在Mac OS X 10.9.3(Mavericks)上运行MATLAB R2013a.有没有人遇到这个错误?该如何补救?

I am running MATLAB R2013a on Mac OS X 10.9.3 (Mavericks). Has anyone encountered this error? How is this remedied?

推荐答案

感谢@RTL在上面的注释中,他发现这是将Java版本更新为1.6.0_39或更高版本后引入的错误.此可以在这里找到.使用至少此版本或更高版本的Java版本运行任何Parallel Computing Toolbox代码可能会引发NullPointerException. distcomp.fileserializer错误是这里的错误之一.

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.

因此,我在上面引用的线程中发布了一个错误修复程序,其中必须更新MATLAB中的几个文件.这是我要解决此错误的步骤:

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. 请访问描述此错误修复程序的以下网站: http://www. mathworks.com/support/bugreports/919688

.zip个文件可用,其中包含您需要在MATLAB中覆盖的必要文件.每种.zip文件都与您使用的MATLAB版本有关.确保下载与您的MATLAB版本相对应的正确 .zip文件.我咨询了上述线程中的一张海报,声称这些文件破坏了他/她的MATLAB,因此需要重新安装.这不是发生在我身上.

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.

运行MATLAB R2013a时,这是我下载的.zip文件的链接:

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

打开MATLAB,然后在命令提示符中键入以下内容:cd (matlabroot)并按 ENTER RETURN .

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

在显示当前文件夹"子窗口的GUI中,右键单击该区域中的任何位置,然后单击在Finder中打开当前文件夹".这将在Finder中打开MATLAB在系统上的位置.就我而言,可以在以下位置找到我的MATLAB:/Applications/MATLAB_R2013a.app

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

现在,关闭MATLAB .

解压缩已下载的.zip文件的内容.您将看到解压缩的存档中有三个文件夹:bugreportjavatoolbox.您只需要担心javatoolbox.

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.

您需要做的就是简单地将javatoolbox文件夹中的内容替换为未压缩的存档,并使用在MATLAB中从步骤4中找到的相同的javatoolbox文件夹.在执行此操作之前,请转到步骤8.

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.

强烈建议您在执行此操作之前保存要覆盖的内容的副本.我只是用后缀old重命名了我要覆盖的文件和文件夹,以便在必要时可以恢复为它们.供您考虑,以下是需要使用.zip文件替换的文件和文件夹:

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
  • java/jarext/distcomp/jiini2/
  • toolbox/distcomp/private/initcommon.m

现在,您已经备份了这些文件,获取了.zip文件的内容,并覆盖了您在MATLAB程序中使用步骤#4找到的文件夹中的内容.

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.

重新启动MATLAB.这应该可以解决此错误,并且对我有用.

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

这篇关于使用Matlabpool时出错-未定义函数'distcomp.fileserializer'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆