What is the number of cores that my fit code uses for running and the efficiency of running it on a cluster?

1 次查看(过去 30 天)
I have a matlab code for fitting a custom model to a series of data. The actual number of data I have is about 600000. I can run the code for a selection of the data (6000 points) and it works fine. But I need to know the answer for the actual data size and when I run the fit code it takes a long time on my laptop for running and it doesn't get to work. I am wondering how can I undrestand how many cores of my laptop are used when the code is running? My laptop has 4 physical cores and when I run Matlab code the Activity Monitor on my MAC says 100% for CPU usage.
I am thinking of runnig my code on a cluster but if in the current laptop it is not using all the available cores I don't think runnig it on a cluster would be helpful. The algorithm of my fit code is not something that I can write it as a suitable format for parallel computing.
Do you have any thoughts?
Thank you inadvance!

回答(1 个)

Walter Roberson
Walter Roberson 2022-6-5
All of your cores are probably being used. The calculations to go from x and proposed model parameters to residues, are typically vectorized. But it depends on the details of the model calculations.
Also, increasing the number of cores too high can reduce performance, due to the increase in communications overhead. Parallel processing with groups of about 6 to 8 cores per worker can sometimes be more effective.
  1 个评论
Shaily_T
Shaily_T 2022-6-6
Thanks for your response! Can we parallelize a fit code if our fit type function value depends on the value of the other points? I think in my code, parallelization is not possible. Could you please elaborate more on "Parallel processing with groups of about 6 to 8 cores per worker can sometimes be more effective."?
If my code can not be parallelized, is there a way to speed up running? Does running it on a cluster and increasing the number of cores make it faster?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Support Vector Machine Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by