MATLAB integration failed

Dear Lumerical,

I just upgraded to MATLAB r2019a and I cannot execute commands in Matlab from Lumerical anymore.
I followed all the steps in https://kb.lumerical.com/install_matlab_integration.html, Matlab integration status is green,the ActiveX test worked fine, and I also performed !matlab /regserver.
In Lumerical, I type “matlab(‘1’);”, for example. I see the Matlab command line opening up in the windows taskbar, but then it disappears, and I get the error:

Can not open a connection to MATLAB. You must have a supported version of MATLAB installed to use this feature. Please see the manual for details

I also checked the other two posts on your forum,

Matlab with Lumerical software
Error in Exporting Data to latest Matlab version

which are not helpful. Can you advise?

Thanks

Hey @norbert.schoenenberg,

I will gladly look into this for you, but could you first confirm that your license for MATLAB r2019a is configured properly? If you open the r2019a application by itself does it launch correctly or ask for licensing information. Please let me know how it goes, and if you still have trouble I will follow up with the development team to see if there are known issues with this version.

-Regards,
Taylor

Hi @trobertson,

Thanks for the quick response. Sure, it works fine, the license is activated and working in order. The version is 9.6.0.1072779 (R2019a) if that makes a difference.

Hey @norbert.schoenenberg,

I could use a bit more information actually to figure this problem out. Do you have other versions of MATLAB installed on this machine? Are they licensed properly as well? What release and version of Lumerical are you using?

-Thanks

Sure. We have the previous version of Matlab still installed, R2015b, which worked fine with Lumerical (incidentally, if I change the Matlab folder in Lumerical to the 2015b version, and do !matlab /regserver again, then the integration works fine). But we don’t want to keep both licenses (unnecessary extra cost) and we require some of the new features developed after 2015b for other purposes.
The Lumerical version is 8.21.1781, release 2019a. Both run on Windows 10 64bit.

Hey @norbert.schoenenberg,

I may have found a workaround, but I would be curious to see if it works for you. On the top tool bar you will see a Resources button. Click on that.

Resources -> Eignesolver tab - Edit (button on the right) -> Resource advanced options -> Job launching preset

Change the option from Microsoft MPI, to Intel MPI. It may require admin privileges. I’ve tested this with a couple builds, and it worked properly. Please let me know how it goes.

Regards,
Taylor

Hi @trobertson,

In “Job launching preset” I have local computer, remote: MPICH2, remote: Microsoft MPI, remote: Intel MPI, and “custom”. When I choose either the Intel or Microsoft MPI, the resources tests fail with “CPI test failed: unknown MPI error”. So I always use MPICH2.
This hasn’t given me any problems so far, so I haven’t looked into it (i.e., into why I can’t work with Microsoft or Intel MPIs).

Hey @norbert.schoenenberg,

To clarify, you can now run using MATLAB 2019a and Lumerical 2019b. Please share any error messages that you are getting. There is a known issue with Microsoft MPI, but INtel should work.

-Thanks

Hi @trobertson,

No, that is incorrect. Intel MPI did not work at all with my previous FDTD version.
I just upgraded to Lumerical 2019b r1 8.22.1976. My MATLAB 2019 version is: 9.6.0.1072779 (R2019a).

I now follow these steps:

  1. FDTD -> Help -> MATLAB integration status -> I choose the 2019a/bin/win64 folder, where libeng.dll is. It says it uses the MATLAB.AutoServer.9.6 automation server.
  2. Windows cmd.exe (in admin mode) -> same MATLAB folder as above -> I type “matlab /regserver”
  3. I now notice that a matlab command window pops up, and the first line reads:

Warning: Directory permission denied: C:\Program Files\Lumerical\FDTD\api\matlab

Let me mention that this was not the case before I upgraded to the latest Lumerical version.

  1. FDTD -> Simulation -> Resource configuration -> Job launching preset = “Remote: MPICH2”.
  2. FDTD -> I type in the command line:

matlab(“plot(1:10);”);

A MATLAB command window opens and disappears quickly, and I get the error:

Error: prompt line 1: Can not open a connection to MATLAB. You must have a supported version of MATLAB installed to use this feature. Please see the manual for details

  1. Per your suggestion, I change the configuration to Intel MPI, but get the exact same result.

Ideas?

Hey @norbert.schoenenberg,

Sorry for the late reply. Could you send a screenshot of the MATLAB integration status with the new version of MATLAB. It may be that your environment path and sys path are not the same?

Thanks,
Taylor

@norbert.schoenenberg,

As for the Job launching preset - you can use Local Computer if you are not running any jobs remotely to another machine. Simply set the THREADS to the desired number of cores/processes you want to run your simulation.
See: https://kb.lumerical.com/installation_and_setup-resource-configuration.html#process_thread

The issue might be due to the multiple MATLAB installs on this machine. The system path might be set to the old registered version of MATLAB and this is also the one the old version of our product sees.

The error you reported shows the location of the previous FDTD version.
Warning: Directory permission denied: C:\Program Files\Lumerical\FDTD\api\matlab`
Do you still have the old version of our product installed?

Can you try and remove the previous versions of our product?

  • please try to do a clean install of our products.
  • remove previous and current versions of Lumerical
  • remove the installation folders
  • remove the preference files
    How to perform a clean installation?

Then reboot the machine. Reinstall the latest version of Lumerical.
See: https://kb.lumerical.com/install_win_install_manual.html

Hope this helps.
-Lito