Error When Using MOSEK solver with parofor

I have the following error when I use MOSEK to solve MISOCP problem:

Error using cvx_mosek>solve (line 447)
Reference to non-existent field ‘sol’.
Error in cvxprob/solve (line 429)
[ x, status, tprec, iters ] = shim.solve( At, b, c, cones, quiet, prec, solv.settings, eargs{:} );
Error in cvx_end (line 88)
solve( prob );
Error in Cmax_svd (line 24)
cvx_end
Error in c_svd (line 10)
parfor jj=1:1e4
The client lost connection to worker 3. This might be due to network problems, or the interactive communicating job might have errored.
Exception in thread “AWT-EventQueue-0” java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at com.mathworks.mlwidgets.help.addon.DemoPath$MatlabPathListener.actionPerformed(DemoPath.java:65)
at java.awt.AWTEventMulticaster.actionPerformed(Unknown Source)
at com.mathworks.jmi.MatlabPath$DeferredActionEvent.dispatch(MatlabPath.java:151)
at com.mathworks.util.QueueEvent$QueueTarget.processEvent(QueueEvent.java:89)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

I used parfor to boost the calculations. I didn’t understand why this error has occurred since the simulation was running normally for one day. Cmax_svd is the function that I’m using to solve the MISCOP problem using MOSEK solver while c_svd is

load('C:\Users\user1\Documents\MATLAB\elp14aaa\svd_opt\Rmax_Pmax\s.mat');
fmax=[1:0.1:2];
B=[20:5:60];
N=8;
for ii=1:length(Pmax)
for kk=1:length(EH)
parfor jj=1:1e4
s1=s(:,jj,kk);
[Cs(kk,jj,ii),~,~,Pts(kk,jj,ii)]=Cmax_svd(N,s1,fmax(ii),B(kk));
end
end
end

Nothing has changed subsequent to this previous thread you started. Using CVX with GPU Parallel Computing

I have changed the solver to Gurobi and the simulation ended normally without any error.

1 Like