Non-linear performance of Java functions in parallel MATLAB

Recently, I have implemented parallelization in my MATLAB , largely offering Slow xlsread sentences in MATLAB . However, the implementation of parallelism caused another problem - a nonlinear increase in processing time with increasing scale .

It seems that the culprit is the java.util.concurrent.LinkedBlockingQueue method, as can be seen from the attached images of the profiler and the corresponding condensed graphs.

Problem: How to remove this nonlinearity, since my work involves processing more than 1000 sheets in one run - which will take an incredibly long time?

Note. The parallel part of the program simply includes reading all the .xls files and storing them in matrices, after which I run the rest of my program. dlmwrite used at the end of the program, and optimization over its time is not actually required, although it can also be suggested.


Profiler details for reading a single Excel sheet from a file having n sheets.

Graph for the times in the above tables.


Processing multiple sheets from file containing multiple sheets.

Processing multiple sheets from file containing multiple sheets.


Culprit:

Enter image description here

Parallelized Code:

 parfor i = 1:runs sin = 'Sheet'; sno = num2str(i); sna = strcat(sin, sno); data(i, :, :) = xlsread('Processes.xls', sna, '' , 'basic'); end 
+4
source share
1 answer

Performing a parallel I / O operation is likely to be a problem (maybe actually slower) if, maybe, if you save everything to an SSD. If you always read the same file, and it is not huge, you can try to read it before your loop and just perform data manipulations in parallel.

0
source

All Articles