Run serial code on parallel cluster interactively

조회 수: 4 (최근 30일)
Khairul Adib Yusof
Khairul Adib Yusof 2024년 1월 10일
댓글: Khairul Adib Yusof 2024년 1월 17일
Hi, I need help from the experts.
Suppose I have a slow machine, and I have an access to a fast parallel cluster. Let say my code is fully serial - no parallel language constructs like parfor or spmd. If I want to run the code on the cluster, of course I can submit a batch job using batch function. But, what if I want to run interactively? So far, interactive processing only allows parallel programming, but if my machine is extremely slow, using even one worker on the cluster is still benificial.
What I do currently is using this workaround:
parpool('MyCluster', 1);
spmd (1)
MyVariable = myFunction.
end
MyVariable = MyVariable{:}
I am looking for a more elegant (official?) solution. Using an spmd as a workaround is far from elegant: (i) codes need to be enclosed by spmd blocks, (ii) variables created in spmd blocks are Composite objects that must be indexed by curly braces first before they can be used/displayed normally.
Please help and suggest a better way. Thanks!
  댓글 수: 6
Damian Pietrus
Damian Pietrus 2024년 1월 16일
Yes, if you wanted to launch MATLAB directly on a compute node, you'd have to connect to it via RDP or SSH depending on it's operating system. You'd then treat it the same as any other MATLAB session, though I'll warn again that you should be cautious of resource contention if you were to try this.
I've put in an internal enhancement request for this type of interactive workflow from a remote client with MATLAB Job Scheduler so our dev team can take it under consideration.
Khairul Adib Yusof
Khairul Adib Yusof 2024년 1월 17일
Thank you Damian for the tremendous help! Looking forward to a better implementation of parallel computing in this manner.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Third-Party Cluster Configuration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by