Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Vânia
Posts:
1
Registered:
5/9/13


Parfor loops and h5write
Posted:
May 9, 2013 6:06 AM


Hello! I'm trying to to use the parfor loop in the matlab parallelism package using 8 cores of my computer. I have a big matrix (129*129*1000*80)  'Input'  so I decided to save my data in h5 file in order to not have memory problems.
So, the problem is: I used parfor and inside the loop I want to load the Input data and save the Output data in h5write file, but it takes a long time and the CPU USage isn't more than 20%. Anyone can help me, how can I improve the performance of my script?
The code:
matlabpool open 8 h5create('Output.h5','/'Output', [129, 129, 39, 80]); w_size=50; tic parfor l = 1:129 for c = 1:129 for w= 1:39 for t= 1:80
val = h5read( 'Input.h5','/'Input',[l c (w1)*(w_size/2)+1 t], [1 1 w_size1 1] ); output = mean(val) ; h5write('Output.h5','/'Output', output, [l c w t], [1 1 1 1] ); end end end end toc
Thanks in advance! Have a nice day!



