我使用的是用Java javaplex编写的工具箱[https://github.com/javaplex/javaplex.github.io][1]
输入矩阵mat [https://drive.google.com/file/d/0B3uM9Np2kJYoTmtkRHV2WU5JeGc/view?usp=sharing][3]的链接
是第一个工作得非常好的循环cd C:\ProjetBCodesMatlab\Jplex
javaaddpath('./lib/javaplex.jar');
import edu.stanford.math.plex4.*;
javaaddpath('./lib/plex-viewer.jar');
import edu.stanford.math.plex_viewer.*;
cd './utility';
addpath(pwd);
cd '..';
max_dimension = 3;
max_filtration_value = 1000;
num_divisions = 10000;
options.max_filtration_value = max_filtration_value;
options.max_dimension = max_dimension - 1;
%------------------------------------------------------------
for i=1:10
maColonne = mat(i,:);
intervals= Calcul_interval(maColonne,options,max_dimension, max_filtration_value, num_divisions)
intervals
multinterval{i}= intervals;
end
执行功能功能('numCores');
时使用I7MATLAB detected: 4 physical cores.
MATLAB detected: 8 logical cores.
MATLAB was assigned: 8 logical cores by the OS.
MATLAB is using: 4 logical cores.
MATLAB is not using all logical cores because hyper-threading is enabled.
我使用parfor
运行相同的代码cd C:\ProjetBCodesMatlab\Jplex
javaaddpath('./lib/javaplex.jar');
import edu.stanford.math.plex4.*;
javaaddpath('./lib/plex-viewer.jar');
import edu.stanford.math.plex_viewer.*;
cd './utility';
addpath(pwd);
cd '..';
max_dimension = 3;
max_filtration_value = 1000;
num_divisions = 10000;
options.max_filtration_value = max_filtration_value;
options.max_dimension = max_dimension - 1;
%------------------------------------------------------------
parfor i=1:10
maColonne = mat(i,:);
intervals= Calcul_interval(maColonne,options,max_dimension, max_filtration_value, num_divisions)
intervals
multinterval{i}= intervals;
end
我有这个错误:不可序列化。
答案 0 :(得分:1)
最后我复制了它。它无法序列化,因为变量c("ordered", "factor")
持有intervals
类型的对象,该对象不可序列化。您必须使其可序列化或提取工人的相关数据。并行计算工具箱只能传输可序列化的数据。