Re: Re: Kernel Timeout
- To: mathgroup at smc.vnet.net
- Subject: [mg43097] Re: [mg42954] Re: Kernel Timeout
- From: "T.Srinivas Kumar" <tskumar at india.com>
- Date: Tue, 12 Aug 2003 04:43:09 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hi Allan, Thank you for your help. But I am looking at utilising the total number of licenses(Kernels) that I have. For example, if I have 5 Kernel processes, then is there an option where if a user is sitting idle or the Kernel is not being utilized for a period of time, can we kill these kernels automatically OR start Kernels giving a time-period after which they get killed so that all the users in the network can utilise the total number of Kernel processes. Thank you for your help. Regards T.S.Kumar ----- Original Message ----- From: "Allan Hayes" <hay at haystack.demon.co.uk> To: mathgroup at smc.vnet.net Subject: [mg43097] [mg42954] Re: Kernel Timeout "T.Srinivas Kumar" <tskumar at india.com> wrote in message news:bgfseh$lld$1 at smc.vnet.net... > Hello, > > How can one can set a timeout period for the Mathematica Kernel. I mean, can we launch Kernel from Mathematica Frontend with a timeout period, may be for 10 seconds so that it gets killed/stopped after 10 seconds? I should also be able to do my computations within Mathematica within this 10 seconds. > > Please let me know the procedure if this is possible. > > Regards > T.Srinivas Kumar > -- > ______________________________________________ > http://www.india.com > Now with POP3/SMTP access for only US$14.95/yr > > Powered by Outblaze > For individual inputs Evaluating ?*Time* gives all commands including Time. Amongst these we find TimeConstrained, which can be used as follows. In[1]:= TimeConstrained[Integrate[Sin[x^5 + x^3], x], .0001, "Out of time"] Out[1]= Out of time To have this happen automatically for all inputs we can use In[2]:= $Pre = Function[x, TimeConstrained[x, .0001, "Out of time"], HoldAll]; Example: In[3]:= Integrate[Sin[x^5 + x^4], x] Out[3]= Out of time We can cancel $Pre In[4]:= $Pre =. -- Allan --------------- Allan Hayes hay at haystack.demon.co.uk Voice: +44 (0)116 241 8747 Fax: +44 (0)870 164 0565 -- ______________________________________________ http://www.india.com Now with POP3/SMTP access for only US$14.95/yr Powered by Outblaze