MATLAB Comsol w/Matlab: CLI vs GUI issues

  • Thread starter Thread starter grumpymrgruff
  • Start date Start date
  • Tags Tags
    Comsol Gui Issues
AI Thread Summary
The user is experiencing issues running Comsol with Matlab through a command-line interface (CLI), specifically with the geomimport() function failing to import a geom.mphbin file, resulting in a Java NullPointerException. The code works correctly when executed via the Comsol Matlab GUI, but the user needs a solution for running it on a computer cluster without GUI access. A suggestion was made regarding a potential typo in the function name, which the user confirmed was not the case in their actual code. Currently, they are utilizing X11 forwarding to run the job on the cluster while hoping to maintain a stable connection. The discussion highlights the challenges of transitioning from GUI to CLI in Comsol with Matlab.
grumpymrgruff
Messages
16
Reaction score
2
Hi all - I've been working on some code in Comsol w/ Matlab that works fine on any machine I run it on - so long as I run it through the Comsol w/ Matlab GUI.

No matter which machine I run it on, the program fails if I run Comsol w/ Matlab through a CLI. Specifically, the geominport() function fails to import my geom.mphbin file with the following error (gap is the name of my model m-file):

Code:
>> gap
? Java exception occurred:
java.lang.NullPointerException
        at com.femlab.server.MlProgressDlg.runAndWait(Unknown Source)
        at com.femlab.server.FlRunnable.a(Unknown Source)
        at com.femlab.server.FlRunnable.smartRunner(Unknown Source)

Error in ==> geomimport at 208
glr.jptr.smartRunner(report, 500);

Error in ==> gap at 23
garr = geomimport('./geom.mphbin');

I am planning to submit this code as a job on a computer cluster where any kind of GUI interface will be out of the question. Has anyone using Comsol/Matlab encountered this problem before, and do you know any workarounds that will let me get my code running without a GUI?

Thanks much!
 
Physics news on Phys.org
Hi,

Can it be that you try to use the function geomimport() but misspelled it to geominport() ?

Good luck
/ T

grumpymrgruff said:
Hi all - I've been working on some code in Comsol w/ Matlab that works fine on any machine I run it on - so long as I run it through the Comsol w/ Matlab GUI.

No matter which machine I run it on, the program fails if I run Comsol w/ Matlab through a CLI. Specifically, the geominport() function fails to import my geom.mphbin file with the following error (gap is the name of my model m-file):

Code:
>> gap
? Java exception occurred:
java.lang.NullPointerException
        at com.femlab.server.MlProgressDlg.runAndWait(Unknown Source)
        at com.femlab.server.FlRunnable.a(Unknown Source)
        at com.femlab.server.FlRunnable.smartRunner(Unknown Source)

Error in ==> geomimport at 208
glr.jptr.smartRunner(report, 500);

Error in ==> gap at 23
garr = geomimport('./geom.mphbin');

I am planning to submit this code as a job on a computer cluster where any kind of GUI interface will be out of the question. Has anyone using Comsol/Matlab encountered this problem before, and do you know any workarounds that will let me get my code running without a GUI?

Thanks much!
 
dontommazo said:
Hi,

Can it be that you try to use the function geomimport() but misspelled it to geominport() ?

Good luck
/ T

Good eye. I didn't notice that. Unfortunately, the typo is only in my post, not in the code. Right now I'm running the job on a cluster with X11 forwarding for the GUI and hoping that I don't lose my connection to the cluster for about a week's worth of computation. ;-)
 

Similar threads

Back
Top