Clear Filters
Clear Filters

buildInstrumentedMex matlab 2017a three times slower than 2016b

2 views (last 30 days)
I have 8 matlab scripts that use buildInstrumentedMex
buildInstrumentedMex schurHybridFix -args {inpH_1,Type_1} -histogram -o schurHybridFix_1_mex
and I run these in a batch
myCluster = parcluster;
job1 = batch(myCluster,'fixed_scen14_ds_11Q21_1','CaptureDiary',true); % do not specify the .m of myScript.m
job2 = batch(myCluster,'fixed_scen14_ds_11Q21_2','CaptureDiary',true); % do not specify the .m of myScript.m
job3 = batch(myCluster,'fixed_scen14_ds_11Q21_3','CaptureDiary',true); % do not specify the .m of myScript.m
job4 = batch(myCluster,'fixed_scen14_ds_11Q21_4','CaptureDiary',true); % do not specify the .m of myScript.m
job5 = batch(myCluster,'fixed_scen14_ds_11Q21_5','CaptureDiary',true); % do not specify the .m of myScript.m
job6 = batch(myCluster,'fixed_scen14_ds_11Q21_6','CaptureDiary',true); % do not specify the .m of myScript.m
job7 = batch(myCluster,'fixed_scen14_ds_11Q21_7','CaptureDiary',true); % do not specify the .m of myScript.m
job8 = batch(myCluster,'fixed_scen14_ds_11Q21_8','CaptureDiary',true); % do not specify the .m of myScript.m
With matlab 2016b this takes 17802 seconds. With matlab 2017a this takes 59040 seconds or 3.3 times longer.
It runs on an Intel core i7 with 4 cores and 8 threads.
OS is Windows 10 in both cases.
What makes 2017a so slow?

Accepted Answer

Bert RAM Aerts
Bert RAM Aerts on 10 Apr 2017
A support engineer of the MathWorks picked up my question, requested matlab code and found the most time consuming task: a matrix multiplication of two 96 by 96 matrices with fixed point datatypes in pure matlab code, while all other fixed point processing was done via buildInstrumentedMex. This matrix multiply was in Matlab R2017a a lot slower than in R2016b. But in the end in my application this was control code that did not need to be in fixed point. By converting these matrices to double before the multiplication, my code became a factor 35 faster: 17802 seconds became 506 seconds. So my title is not correct to state that buildInstrumentedMex is slower in R2017a. My problem is solved but I was not informed why this fixed point matrix multiply was a lot slower in R2017a.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!