Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Parallel Computing using GA in MatLab Livelink
Posted 28 lug 2020, 01:56 GMT-4 0 Replies
Please login with a confirmed email address before reporting spam
Hi everyone,
I am currently trying to use GA in Matlab to optimize my function. But I have some trouble with "Parallel Computing using GA in MatLab Livelink" and i had searched over the Discussion Forum of comsol. According to the following url: https://cn.comsol.com/forum/thread/33446/parallel-computing-matlab-comsol http://cn.comsol.com/forum/thread/38557/parallel-computing-with-matlab-livelink-and-comsol?last=2013-07-20T17:37:08Z
I learned how to open multiple services, which helped me a lot. However, there are still other errors in my program. For example, when i used the code in the runfile:
core=2; pp=parpool(core); comsolPort1 = 2036; system( ['D:\COMSOL\COMSOL55\Multiphysics\bin\win64\comsolmphserver.exe -np 1 -port ' num2str(comsolPort1) ' &'] ); pause(1) comsolPort2 = 2037; system( ['D:\COMSOL\COMSOL55\Multiphysics\bin\win64\comsolmphserver.exe -np 1 -port ' num2str(comsolPort2) ' &'] ); pause(1)
and the next code in my function contains my Comsol model :
cd('D:\COMSOL\COMSOL55\Multiphysics\mli') comsolPort=[2036 2037]; t = getCurrentTask() labit=t.ID mphstart(comsolPort(labit))
The calculation of the first round can be performed, but an error will be reported when the second round begins: Error using mphstart Already connected to a server
I thought the first-round model was still occupying ports, so I added the statement "Modelutil.disconnect;", but the calculation again prompted an error: Error using mphstart A connection to COMSOL could not be established. Please check that a COMSOL server is started prior to calling mphstart
I'm confused. Is there anything else to deal with? Or I need the sever version?
Hello Weikai Xu
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.