在Linux上从Java使用Matlab Parpool时出错

时间:2018-07-05 15:12:26

标签: java linux matlab

我需要在自己的Java应用程序中使用编译为JAR文件的MATLAB库。该库使用parpool并具有一些parfor运算符。我们可以使用this example作为测试。

在Windows上可以使用。在Linux(Ubuntu xenial)上,出现类似this的错误,但不一样:

Starting parallel pool (parpool) using the 'local_mcruserdata' profile ...

Error using parpool (line 104)
Failed to start a parallel pool. (For information in addition to the causing error, validate the profile 'local_mcruserdata' in the Cluster Profile Manager.)

Error in sample_pct (line 11)


Caused by:
    Error using parallel.internal.pool.InteractiveClient>iThrowWithCause (line 666)
    Failed to initialize the interactive session.
        Error using parallel.internal.pool.InteractiveClient>iThrowIfBadParallelJobStatus (line 767)
        The interactive communicating job failed with no message.

The error is com.mathworks.toolbox.javabuilder.MWException: Failed to start a parallel pool. (For information in addition to the causing error, validate the profile 'local_mcruserdata' in the Cluster Profile Manager.)

在两个系统上我的MATLAB均为9.2.0.538062(R2017a),而我的JDK为1.8.0_171 x86_64。

如果我在第11行注释(parpool函数调用),该错误消失了,但是parfor运算符不会创建额外的工作程序。

这是一个已知的错误,可以修复吗?

1 个答案:

答案 0 :(得分:0)

在示例中添加Scope后(如注释中所建议),我得到了消息:

setSchedulerMessageHandler(@disp); setenv('MDCE_DEBUG','true')

matlabroot/bin/glnxa64/ctfxlauncher: error while loading shared libraries: libmwmclmcrrt.so.9.2: cannot open shared object file: No such file or directory给出find matlabroot -name libmwmclmcrrt.so.9.2

matlabroot/runtime/glnxa64/libmwmclmcrrt.so.9.2目录添加到matlabroot/runtime/glnxa64很有帮助!