Check available number of licenses #3448
-
Is there any existing method to get the available number of licenses for a particular license type? For example, something like check_available_licenses("meba") to get back the number of meba licences available to use? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Hi @saitade-bh I am afraid we have no pythonic method to know that... at least not with PyMAPDL. @RobPasMue I guess there is not such capability within PyAnsys ecosystem, am I right? I am aware though that there are discussions in this direction. |
Beta Was this translation helpful? Give feedback.
-
@saitade-bh @germa89 @RobPasMue You would replace 127.0.0.1 with the hostname or IP address of the license server. This could be found in the C:\Program Files\ANSYS Inc\Shared Files\Licensing\ansyslmd.ini file. You would have to parse out the output to get the number available (the command gives more than a simple number). And I've no idea how to issue from Python (was playing around with the subprocess library but did not quite get it to work). But maybe this is enough of a starting point. A word of caution - if you do create something please, please build in a wait/pause feature. We don't want to be pinging the license server with thousands of requests per minute/second/whatever. That way lies a denial-of-service attack. If you are laughing this advice off it comes from real world direct technical support experience. lmstat is getting the license information from the license server without regard to the license options file, if one exists. The option file rules only kick in on check-out...at least that is my understanding. lmutil is a FlexNet application (licensing), not Ansys Inc. Mike |
Beta Was this translation helpful? Give feedback.
-
I was able to get away with this in Python. Thanks a ton Mike!
|
Beta Was this translation helpful? Give feedback.
Hi @saitade-bh
I am afraid we have no pythonic method to know that... at least not with PyMAPDL.
@RobPasMue I guess there is not such capability within PyAnsys ecosystem, am I right? I am aware though that there are discussions in this direction.
@MaxJPRey @koubaa for awareness.