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.

"wait" option missing when using COMSOL/Matlab with a scheduler (Python)

Please login with a confirmed email address before reporting spam

Hello,

I am using COMSOL/Matlab with a scheduler (Python).

For ordinary Matlab it is possible to use the wait option, e.g. matlab -nodesktop -minimize -r -wait "checkMail, exit", which tells the scheduler to wait till 'checkMail.m' is completed.
Reference: www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabwindows.html

However, the "wait" option does not work for COMSOL/Matlab, e.g. C:/Programme/Comsol35a/bin/comsol.exe matlab -ml /nodesktop -ml /nosplash -ml /wait -mlr "flreport('off'), mainprogram, exit"
This holds, even though COMSOL tells, that the ordinary Matlab options can be used:
www.comsol.com/support/knowledgebase/980/

Is there any way to use the "wait" option?

I ended up writing an ASCII file and telling the scheduler to wait for this file to be written.
Contacting COMSOL support was not very helpful, at least so far.

Regards,

Andreas

1 Reply Last Post 14 mar 2010, 10:48 GMT-4
COMSOL Moderator

Hello Andreas Kapp

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.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 mar 2010, 10:48 GMT-4
I had exactly the same problem and couldn't get the wait option to work. What i eventually did was create a batch file for each model i wanted to run and then created a main batch file which called each one of these individually using: "start /wait <path>\Batch.bat".

So my main batch file looked like:

start /wait <path>\Batch1.bat
start /wait <path>\Batch2.bat
start /wait <path>\Batch3.bat
start /wait <path>\Batch4.bat

and the contents of for example Batch1.bat was:

start c:\COMSOL35\bin\comsol.exe matlab -ml /nodesktop -ml /nosplash -mlr "cd <path_to_model>; model1".

Not sure if this helps you though as havent used python scheduler
I had exactly the same problem and couldn't get the wait option to work. What i eventually did was create a batch file for each model i wanted to run and then created a main batch file which called each one of these individually using: "start /wait \Batch.bat". So my main batch file looked like: start /wait \Batch1.bat start /wait \Batch2.bat start /wait \Batch3.bat start /wait \Batch4.bat and the contents of for example Batch1.bat was: start c:\COMSOL35\bin\comsol.exe matlab -ml /nodesktop -ml /nosplash -mlr "cd ; model1". Not sure if this helps you though as havent used python scheduler

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.