How to write a parallel computing script for this situation?

1 次查看(过去 30 天)
I have a program that has been running for more than a week. I have no idea how many additional days it will take. Would anyone please help me write a parallel computing script for it?
It is as simple as this:
z = f(x, y)
The thing is that my x and y have a size of 40 million (row) x 1 (column). Normally, it would be much faster to run them together as column variables, instead of going through them one row at a time.
What would my parfor loop look like?
Many thanks!
  1 个评论
John D'Errico
John D'Errico 2021-7-24
There is a strong chance that your code is simply written poorly, that a parallel computing solution is the wrong approach. But that is impossible to know. You would be best served by spending the time to lean to use the profiler tool, to see whereyour code is slow. And to learn ways to improve your code. But this question is not a question about MATLAB, just a bulletin board request, asking for somoen to provide code and general tutoring on how to use a toolbox, without knowing anything about your real problem, or even if it would help.

请先登录,再进行评论。

回答(1 个)

Leon
Leon 2021-7-24
Many thanks for the input, John!
To clarify, the function is not my code. It is a peer-reviewed one from someone else.
Were you inferring that the Mathworks Q&A section is for bug reporting related issues only? I totally understand if you do not want to help because my question will involve someone to provide some code. However, belive it or not, that's what 90% of the questions are about here. Therefore, I would appreciae it if you do not close my ticket because of that. I hope you have a good weekend.

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by