java - 在 Linux 上从 Java 使用 Matlab parpool 时出错

标签 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 运算符不会创建额外的 worker。

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

最佳答案

添加后setSchedulerMessageHandler(@disp); setenv('MDCE_DEBUG','true') 示例(正如评论中所建议的那样)我收到了消息:

matlabroot/bin/glnxa64/ctfxlauncher:加载共享库时出错:libmwmclmcrrt.so.9.2:无法打开共享对象文件:没有这样的文件或目录

find matlabroot -name libmwmclmcrrt.so.9.2 给出 matlabroot/runtime/glnxa64/libmwmclmcrrt.so.9.2

matlabroot/runtime/glnxa64 目录添加到 LD_LIBRARY_PATH 有帮助!

关于java - 在 Linux 上从 Java 使用 Matlab parpool 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51194780/

相关文章:

matlab - 按某些颜色的像素对 jet 颜色图进行分类

image - 将不是特定强度的单色归零

MATLAB 多项式拟合选择幂

java - cc 内的 UIInput 值 :insertChildren are not redisplayed after validation failure

java - Spark Combinebykey JAVA lambda 表达式

linux - 如何在 shell 中删除除 "1.jpg"之外的所有 jpg 文件

linux 交叉编译链接器问题, undefined reference `g_thread_init' 和 `org_freedesktop_DBus_request_name'

java - 在已排序的 HashMap 中选择顶部 'n' 条目

java - 尝试处理用户输入的异常

linux - 全新安装时安装 vim 插件 vundle 失败