Executable with arguments inside a parfor loop with system()

조회 수: 9 (최근 30일)
Jayanth M. Dabbi
Jayanth M. Dabbi 2019년 4월 4일
답변: Hitesh Kumar Dasika 2019년 4월 10일
Hello all,
I am attempting to run an executable file within a parfor loop to perform a number of simulations in parallel. My first step is to set up a structure of the different conditions for each simulation. Then, I run the parfor loop for the length of this structure and run the system command with arguments in the loop. This works in a regular for loop, but stops after the first completed iteration with a parfor loop. Any suggestions?
Thanks in advance,
Jayanth

답변 (1개)

Hitesh Kumar Dasika
Hitesh Kumar Dasika 2019년 4월 10일
From the provided information, there is a possibility that the code that you are trying to run has some dependencies and those dependencies might not be accessible from the parallel workers and are accessible in the normal for loop execution because they are in the same directory. Please take a look at the below attached documentation link that talks about sharing code and data across workers.
If this is not the issue that you are facing, please elaborate on what kind of errors that you are encountering and also specific details about your workflow

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by