Run exe file in MATLAB using multiple cores

8 次查看(过去 30 天)
Hi,
I am using MATLAB to run OpenSeesSP.exe. Typically, I use the below code to run OpenSees using single core and it runs in MATLAB command window
system(['OpenSeesSP ' 'fileName.tcl']);
To run OpenSeesSP using multiple cores, I use the following code. However, OpenSeesSP runs in an external cmd window
!"C:\Program Files\MPICH2\bin\mpiexec.exe" -np 5 OpenSeesSP.exe fileName.tcl &
What should I use to run OpenSeesSP with multiple cores in MATLAB command window not in an external cmd window. I tried the below line of code but it did not work.
system(['"C:\Program Files\MPICH2\bin\mpiexec.exe" -np 5 OpenSeesSP.exe' 'fileName.tcl']);
Basically, I am gonna use this command in a for loop where I need some output from OpenSeesSP to proceed with the for loop. Thus, I need MATLAB to wait until OpenSeesSP completes its analysis.
Thanks!
  3 个评论
Jan
Jan 2021-2-3
Please explain, what "did not work" means. The details matter to understand, what the problem is.

请先登录,再进行评论。

回答(2 个)

Byron Z
Byron Z 2021-1-19
Hi, I'm using opensees to caculate a large model BUT I found that I can't download the OpenseesSP.exe...... Could you give me a copy file or a link?
  8 个评论
Walter Roberson
Walter Roberson 2021-2-3
https://opensees.berkeley.edu/community/ucp.php?mode=register just might work??
Byron Z
Byron Z 2021-2-3
hhhhhhhhhaaaaaaaaa, yes!!! thankyou, I've download it, thank you again

请先登录,再进行评论。


matias garrido
matias garrido 2021-2-1
编辑:matias garrido 2021-2-1
Hi, I'm run OpenSeesSPv2.4 with a parfor (run each model with 2 cores, and run simultaneusly 4 models). I use this code lines for run OpenSeesSP since matlab.
% Run the model.
% -------------------------------------------------------------------------
oldFolder = cd(Path_current);
command = ['mpiexec -n 2 OpenSeesSP_x64 Dynamic_Analysis.tcl'];
[status,~] = system(command); % Run OpenSees.
cd(oldFolder);
I hope that it will help you.
What is your OpenSeesSP version?, I need a current version of OpenSeesSP, at least a version that allow run a model with 6 inputs ground motion (3 translational with 3 rotational).
Bests, M.

类别

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

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by