フィルターのクリア

Run a function (script) by using different processes

7 ビュー (過去 30 日間)
Sara
Sara 2020 年 7 月 15 日
回答済み: Walter Roberson 2020 年 7 月 15 日
Hello everyone,
In my case i have a function F1 and i want to run this function by 2 different processes at the main program in the same time, to compaire the results
My question is : How can i run this function by the 2 processes at the same time

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 7 月 15 日
You need the Parallel Computing Toolbox. Once you have that, you can use any of:
  • spmd
  • parfor
  • parfeval
  • batch
Notes:
  • when you use parallel processes, only one at a time can access any particular GPU
  • Unless you specifically configure otherwise, the workers only get a single core to execute in. This can affect the results compared to the automatic parallel processing that MATLAB does for some operations. In particular, any kind of "reduction" such as sum() can come out slightly different for floating point numbers.

カテゴリ

Help Center および File ExchangeParallel for-Loops (parfor) についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by