22
$\begingroup$

I know that Mathematica checks the validity of its license every time the program is launched.

Say, however, that I have a valid license (which I do) and that I am running some code which takes a long time to evaluate and includes multiple separate instructions being sent to the kernel (i.e. not all in a single cell evaluation). If the license server in my institute goes down will Mathematica continue to run without error as long as I keep the program open or will it immediately give an error and cease operation?

In brief: Does Mathematica check its license only at launch or continually while it is open?

Theres no license tag apparently....

$\endgroup$
7
  • 1
    $\begingroup$ While I have no definitive answer (nor can I capture traffic on my work machine to check), I know from experience that if the license server goes down, mma does not close. I've had it run for a couple of hours, finish the task, and exit, while the license server was dead (according to IT support). So, unless it was somehow coming online briefly, it seems that this puts a lower bound on the period with which it checks. $\endgroup$
    – acl
    Oct 12, 2012 at 11:51
  • 1
    $\begingroup$ @acl Thanks for the feedback on your own experience. I've had similar ones. I suspect its only on opening and it would be useful if that was the case. $\endgroup$
    – fizzics
    Oct 12, 2012 at 12:07
  • 1
    $\begingroup$ I'm sure that Mathematica contacts the license server from time to time, because otherwise the license server would not learn that the license from a crashed (or manually killed) Mathematica process is free again. However I don't know what it does if the license server is not available. Maybe that's even something configurable (at the license server, of course). $\endgroup$
    – celtschk
    Oct 12, 2012 at 12:21
  • 5
    $\begingroup$ A few years ago my home license expired (I recall it was for version 7) and I waited a couple of weeks to renew it. By keeping MMA open the entire time, I was able to continue working with it. This suggests the license is checked only at startup or perhaps only when a kernel is launched. $\endgroup$
    – whuber
    Oct 12, 2012 at 14:06
  • 2
    $\begingroup$ I believe the answer depends on how the license server is administrated. There is a timeout option that can be given to the license manager, but this hasn't been very often used in my experience. In most cases I've seen, it worked like acl has described. $\endgroup$
    – Searke
    Oct 12, 2012 at 14:19

1 Answer 1

29
$\begingroup$

Typically, Mathematica contacts the license server every 2 minutes. If you have a license which supports a very large number of processes, that interval can grow (to help MathLM to scale better). It will never be more than 30 minutes.

If three consecutive license checks fail, then Mathematica will instead revalidate the entire license file on what would have been the fourth consecutive check. If that also fails (even if the MathLM server is down, it's potentially conceivable that there's another valid entry in the license file), then the front end will force you to either fix the licensing situation or quit Mathematica. It will allow you to save files before quitting, but it won't allow you to perform any more work.

$\endgroup$
8
  • 2
    $\begingroup$ Is there any way to force the front end to accept a revalidated license? I work on the bus ride back home (till the kernel bails out on me) and continue at home once I have internet access (which validates the license). I've found that once the front end decides to switch into the free CDF mode, there is no making it go back. Any open notebooks continue to be notebooks (with the kernel working), but new ones are launched as CDFs. This is extremely annoying, because I have to then close all my other notebooks and reopen them just so I can get 1 more new notebook... $\endgroup$
    – rm -rf
    Apr 20, 2013 at 1:06
  • 3
    $\begingroup$ @rm-rf Sorry, no options at the present for this. Hoping to be able to give you more satisfaction in a not-too-distant version release... $\endgroup$
    – John Fultz
    Apr 22, 2013 at 23:32
  • 1
    $\begingroup$ How long does MathLM wait until it frees an occupied license if a kernel crashes? $\endgroup$
    – sakra
    Nov 11, 2014 at 15:35
  • 2
    $\begingroup$ @sakra It varies based upon how many processes MathLM is licensing. For a typical smaller licensing situation, it'll be 3-5 minutes. The answer is a range because there's a 2 minute ping, and the precise time depends upon how long it is from the kernel crash until the next expected ping, which will be the first point that MathLM has any indication that something might have gone wrong. After the second missed ping, MathLM waits 60 more seconds, then times out the license. For licenses of more than 30 processes, that time stretches out because the ping times stretch out. $\endgroup$
    – John Fultz
    Nov 14, 2014 at 22:29
  • $\begingroup$ @JohnFultz: So there is no way to allocate in advance, say 1h? I find this behaviour extremely distracting in lectures (with an unreliable wireless) such that I refrain from life sessions. $\endgroup$
    – false
    Jul 12, 2016 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.