Running on cluster without parallel server with slurm

4 ビュー (過去 30 日間)
Leos Pohl
Leos Pohl 2021 年 7 月 20 日
編集済み: Leos Pohl 2021 年 7 月 20 日
I have access to a cluster where there is only a single matlab license and it is to be used for compilation purposes only with mcc. I have a program that has the following structure:
for i = 1:m
% outer loop running on various nodes (MPI analogy)
parfor j = 1:n
% inner loop running on a node (openMP analogy)
end
end
Since i cannot make use of the matlab parallel server to distribute the outer loop, I was thinking of creating the function that contains the inner loop and is called with various parameters. But this runs into an issue that everytime this function is called, the matlab first needs to create parallel workers which takes huge amounts of time and when the function finishes the workers are killed and cannot be reused for the next iteration of the outer loop on that node.
One way around that that i can think of is to make the outer loop as:
for i = 1:m_q
% here is the partial outer loop
parfor j = 1:n
% inner loop running on a node (openMP analogy)
end
end
Here m_q < m and it is a fixed distribution of load for a given node.
Is there any better way to do this?
  2 件のコメント
Walter Roberson
Walter Roberson 2021 年 7 月 20 日
It is not clear to me why you cannot use
pool = parpool();
for i = 1:m
% outer loop running on various nodes (MPI analogy)
parfor (j=1:n, pool)
stuff
end
end
delete(pool)
?
Leos Pohl
Leos Pohl 2021 年 7 月 20 日
編集済み: Leos Pohl 2021 年 7 月 20 日
How would I run the outer loop on various nodes of the cluster?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Parallel Server についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by