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.

Solution to comsol giving "Server is in use by another client" error

Tom M Fluid Mechanics and Mathematical Physiology

Please login with a confirmed email address before reporting spam

The below post is related to an archived discussion


Hi Samuel,

I have found that adding pauses between execution lines in the script helps the script to run, in particular using try-catch statements so that if there is an error, get the script to pause for a few seconds and then run the same line again. I do this with an increasing pause until the pause length reaches a certain value when I assume that pausing the script before going again is not the solution.

I do not know why Comsol does this but I guess that what may be happening is that matlab moves on and tries to execute a new line when Comsol may still be running the line before. When this happens, Comsol gets confused and thinks that another client is trying to get it to do stuff, hence the error that you receive. But again, this may not be the problem, but just my best guess as to what is going on.

Hope that this is helpful,

All the best,

Tom


6 Replies Last Post Oct 9, 2021, 3:06 p.m. EDT
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Sep 29, 2021, 4:11 a.m. EDT

Hi Tom

I assume you are seeing this when there is in fact only one client connected to the Comsol Multiphysics server? I.e. Matlab is the only client connected?

Error handling is difficult. Using try...catch constructs is a method for catching en error condition in Comsol, but it is not always straigt forward to figure out what to do after an error has been caught. Just running the failing line again may not be what you want.

In any event, you should be seeing the "Server Is In Use By Another Client" when you are only connected with one client. I suggest you send your code to support where someone can have a look at it.

-------------------
Lars Gregersen
Comsol Denmark
Hi Tom I assume you are seeing this when there is in fact only one client connected to the Comsol Multiphysics server? I.e. Matlab is the only client connected? Error handling is difficult. Using try...catch constructs is a method for catching en error condition in Comsol, but it is not always straigt forward to figure out what to do after an error has been caught. Just running the failing line again may not be what you want. In any event, you should be seeing the "Server Is In Use By Another Client" when you are only connected with one client. I suggest you send your code to support where someone can have a look at it.

Tom M Fluid Mechanics and Mathematical Physiology

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Sep 29, 2021, 4:16 a.m. EDT

Hi Lars,

Thank you for your relpy. This post was to answer the question posed in the archived discussion for which there is a link at the top of my post.

With the try-catch and pausing method, my code runs fine now but I would be interested to know why Comsol does throw this error when there is only one client (Matlab) connected to it please?

All the best,

Tom

Hi Lars, Thank you for your relpy. This post was to answer the question posed in the archived discussion for which there is a link at the top of my post. With the try-catch and pausing method, my code runs fine now but I would be interested to know why Comsol does throw this error when there is only one client (Matlab) connected to it please? All the best, Tom

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Sep 29, 2021, 7:47 a.m. EDT

Hi Tom

Oh, I see.

I haven't seen this problem myself. Without some example that reproduces this problem we can't do much about this issue.

-------------------
Lars Gregersen
Comsol Denmark
Hi Tom Oh, I see. I haven't seen this problem myself. Without some example that reproduces this problem we can't do much about this issue.

Tom M Fluid Mechanics and Mathematical Physiology

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Oct 1, 2021, 11:33 a.m. EDT

Hi Lars,

Thank you very much for your replies. I believe that the query I was responding to, which there is a link to in my original post, has some example scripts which were having this problem

All the best,

Tom

Hi Lars, Thank you very much for your replies. I believe that the query I was responding to, which there is a link to in my original post, has some example scripts which were having this problem All the best, Tom

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Oct 4, 2021, 7:09 a.m. EDT

Hi Tom

I have tried running Samuel Ayinde's example code, and I have no problems running his code. Also the error message that Samuel writes doesn't seem to come from the uploaded example code since there is no call to mphmatrix.

We'll happily look into this issue more, but we do need an example that reproduces the problem. Every night we run thousands of tests and have not seen this problem.

-------------------
Lars Gregersen
Comsol Denmark
Hi Tom I have tried running Samuel Ayinde's example code, and I have no problems running his code. Also the error message that Samuel writes doesn't seem to come from the uploaded example code since there is no call to mphmatrix. We'll happily look into this issue more, but we do need an example that reproduces the problem. Every night we run thousands of tests and have not seen this problem.

Tom M Fluid Mechanics and Mathematical Physiology

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Oct 9, 2021, 3:06 p.m. EDT

Hi Lars,

This is strange that you are unable to find this problem, do you run tests on Comsol through the livelink to Matlab and use Comsol models that take a while to compute as I think that this s where the problems come from?

Hi Lars, This is strange that you are unable to find this problem, do you run tests on Comsol through the livelink to Matlab and use Comsol models that take a while to compute as I think that this s where the problems come from?

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.