ensberg
ensberg

Reputation: 31

serializability java Matlab

I use a toolbox written in Java javaplex [https://github.com/javaplex/javaplex.github.io][1]

the link for the input matrix mat [https://drive.google.com/file/d/0B3uM9Np2kJYoTmtkRHV2WU5JeGc/view?usp=sharing][3] the first loop which is working very good is for

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 

I use a I7 when I execute the function feature('numCores');

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

I run the same code with 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 

i have this error : is not serializable.

Upvotes: 0

Views: 172

Answers (1)

Daniel
Daniel

Reputation: 36710

Finally I got it reproduced. It can not be serialized because your variable intervals is holding an object of type edu.stanford.math.plex4.homology.barcodes.BarcodeCollection which is not serializable. You have to make it serializable or extract the relevant data on the workers. The parallel computing toolbox can only transport data which can be serialized.

Upvotes: 1

Related Questions