OK, but doesn’t that mean that Matlab will attempt to construct multiple CVX models simultaneously? Unfortunately, CVX cannot handle that, because it uses a single non-reentrant data structure to store model data.
I am not aware how Matlab runs parallel CVX codes, but I have another code in which there is a “parfor” loop and a function is called inside the loop. The CVX is implemented inside the function and this code runs OK and there is no problem. Logically, the current code should run OK.
Or you simply got lucky with your previous code. If you were lucky enough to use it in the past, so be it, but that in no way guarantees you will be able to do so in the future. By all means, do make sure that the version of CVX you’re running on Linux is up to date.
OK. The CVX on the linux machine is the same as on my laptop (V 1.22). I run both codes on the linux machine today. One was run and the other failed. Even, when I change the loop to non-parallel, it again fails.
1.22 is quite old, you know… I do strongly recommend 2.0 at this point. I’m afraid it is unlikely that will solve all problems with parfor, but if there is another bug at work, you’ll certainly want to try the latest version.
Thank you Michael, thank you for the comments. I changed the version to 2 and the problem just solved. However, I would like to mention that previously the CVX V2 produced some error on my laptop, but when I switched to V1.22, it fixed.
Thank you for supporting us. I think the CVX2 is operating well since I changed some of the parameters and then for some cases the problem became feasible. So, at lease we can make sure that CVX2 is OK.