search for: settimelimit

Displaying 20 results from an estimated 25 matches for "settimelimit".

2016 Oct 26
5
BUG?: On Linux setTimeLimit() fails to propagate timeout error when it occurs (works on Windows)
setTimeLimit(elapsed=1) causes a timeout error whenever a call takes more than one second. For instance, this is how it works on Windows (R 3.3.1): > setTimeLimit(elapsed=1) > Sys.sleep(10); message("done") Error in Sys.sleep(10) : reached elapsed time limit Also, the error propagates immedia...
2012 Jan 13
0
WISHLIST: Be able to timeout readline()/stdin via setTimeLimit in all consoles
Hi. WISHLIST: Regardless on console, I'd like to be able to timeout a call to readline()/file("stdin", blocking=TRUE) via setTimeLimit. OBSERVATION: On Windows Rterm as well as plain R on Linux, setTimeLimit() does not momentarily interrupt from stdin, but only after hitting RETURN. A few examples: timeout00 <- function() { setTimeLimit(elapsed=5); Sys.sleep(10); } timeout01 <- function() { setTimeLimit(elapsed=5)...
2016 Sep 18
0
getGraphicsEvent() and setTimeLimit() bug and compatibility patch.
Hey all. Setting a time limit with setTimeLimit(), and then using getGraphicsEvent(), will cause graphics event handling for the current device to break on timeout, until the device is destroyed and recreated. The problem lies in do_getGraphicsEvent() checking the value of dd->gettingEvent and concluding it's being called recursively (ir...
2011 Dec 16
2
Event handling in R
...ing if there is a simple way to stop this function waiting for input after a pre-defined time, instead of relying either on a non-NULL value from one of the event handlers or for a user-interrupt for it to halt (as per the R manual). The only way that I've thought of to make this work is using setTimeLimit to kill the function after a set time - here's a (messy) example: setTimeLimit(cpu = 1) plot(0, 0) eventEnv <- getGraphicsEventEnv() setGraphicsEventHandlers(prompt = 'Test') while(TRUE) { err <- try(q <- getGraphicsEvent(), silent=TRUE) print(err) } # Not run setTimeLi...
2016 Oct 26
0
BUG?: On Linux setTimeLimit() fails to propagate timeout error when it occurs (works on Windows)
On 10/25/2016 9:44 PM, Henrik Bengtsson wrote: > setTimeLimit(elapsed=1) causes a timeout error whenever a call takes > more than one second. For instance, this is how it works on Windows > (R 3.3.1): > >> setTimeLimit(elapsed=1) >> Sys.sleep(10); message("done") > Error in Sys.sleep(10) : reached elapsed time limit > &gt...
2016 Oct 26
3
BUG?: On Linux setTimeLimit() fails to propagate timeout error when it occurs (works on Windows)
...ible on macOS expect for Spencer; that might indicate a difference in builds. BTW, my original post suggested that timeout error was for sure detected while running Sys.sleep(10). However, it could of course also be that it is only detected after it finishes. For troubleshooting, the help("setTimeLimit", package = "base") says that: * "Time limits are checked whenever a user interrupt could occur. This will happen frequently in R code and during Sys.sleep, but only at points in compiled C and Fortran code identified by the code author." The example here uses Sys.sleep()...
2016 Oct 31
1
BUG?: On Linux setTimeLimit() fails to propagate timeout error when it occurs (works on Windows)
...kets are not interruptable -- >> that should probably be looked into. I'll address the sleep issue sometime soon but I won't be able to look into the blocking read issue for many months. SOmeone else might have a chance to look earlier. But for the situation you describe below using setTimeLimit doesn't seem like the right approach. The parallel code is not written for situations that need this kind of fault tolerance; it is not robust to user interrupts and would not be to timer interrupts either. If you are concerned that some potential workers might not be available then you would b...
2016 Oct 27
2
BUG?: On Linux setTimeLimit() fails to propagate timeout error when it occurs (works on Windows)
...016, peter dalgaard wrote: > Spencer also had tools and rsconnect loaded (via a namespace) but it doesn't seem to make a difference for me if I load them. It also doesn't seem to matter for me whether it is CRAN R, locally built R, Terminal, R.app. However, RStudio differs > >> setTimeLimit(elapsed=1) > Error: reached elapsed time limit >> setTimeLimit(elapsed=1) > Error: reached elapsed time limit >> setTimeLimit(elapsed=1); system.time({Sys.sleep(10);message("done")}) > Error in Sys.sleep(10) : reached elapsed time limit > Timing stopped at: 0.003 0...
2016 Oct 26
0
BUG?: On Linux setTimeLimit() fails to propagate timeout error when it occurs (works on Windows)
Spencer also had tools and rsconnect loaded (via a namespace) but it doesn't seem to make a difference for me if I load them. It also doesn't seem to matter for me whether it is CRAN R, locally built R, Terminal, R.app. However, RStudio differs > setTimeLimit(elapsed=1) Error: reached elapsed time limit > setTimeLimit(elapsed=1) Error: reached elapsed time limit > setTimeLimit(elapsed=1); system.time({Sys.sleep(10);message("done")}) Error in Sys.sleep(10) : reached elapsed time limit Timing stopped at: 0.003 0.003 0.733 -pd > On 2...
2016 Oct 31
0
BUG?: On Linux setTimeLimit() fails to propagate timeout error when it occurs (works on Windows)
...eneral. 100000 might be a good value. > > A more worrying thing I noticed while looking at this is that blocking > reads on fifos and pipes and probably sockets are not interruptable -- > that should probably be looked into. This is actually related to the use case where I want to use setTimeLimit(). When using parallel:::newPSOCKnode(), there's a 30-day timeout associated with the socket connection. Now, this long timeout is needed in order for long-running tasks to not to timeout the master-worker connection. However, when it comes to the actual setup of the connection, then it wou...
2013 May 16
1
setTimeLimit sometimes fails to terminate idle call in R
I would like to use setTimeLimit to abort operations that are stuck waiting (idle) after n seconds. Below a toy example in which Sys.sleep is a placeholder call that is idle: testlimit <- function(){ setTimeLimit(elapsed=3, transient=TRUE); Sys.sleep(10); } system.time(testlimit()); However this is giving inconsistent res...
2019 May 22
1
make running on.exit expr uninterruptible
...rupt this function such that cntr_f is incremented while cntr_on.exit is not (you might need to adjust timeout_upper to trigger the error on your machine): timeout_upper <- 0.00001 repeat { cntr_f <- 0L cntr_on.exit <- 0L # timeout code borrowed from R.utils::withTimeout but with setTimeLimit() # (correctly) place inside tryCatch (otherwise timeout can occur before it can # be caught) and with time limit reset before going into the error handler res_list <- lapply(seq(0, timeout_upper, length.out = 1000), function(timeout) { on.exit({ setTimeLimit(cpu = Inf, elapsed =...
2018 Jan 19
1
setSessionLimit
Hello The doc/NEWS.2 file mentions a setSessionLimit function, added with version 2.8.0 ??? o?? setTimeLimit() function to set limits on the CPU ??????? and/or elapsed time for each top-level computation, and ??????? setSessionLimit() to set limits for the rest of the session. However, I no longer see this function in recent versions of R, and there is no mention of its removal in the NEWS nor in the...
2011 Aug 26
1
kernlab: ksvm() bug?
...I'm trying to run a gird parameter search for a svm. Therefore I'M using the ksvm function from the kernlab package. ---- svp <- ksvm(Ktrain,ytrain,type="nu-svc",nu=C) ---- The problem is that the optimization algorithm does not return for certain parameters. I tried to use setTimeLimit() but that doesn't seem to help. I suspect that ksvm() calls c code that does not respond to the time limit. I don't know what else to try. Should this be considered to be a bug? Does anyone know a workaround? best regards, Immanuel
2011 Apr 12
1
Signal handling / alarm timeouts
What are the ramifications of setting up user signal handling to allow the use of e.g. alarm(2) to send a SIGALRM to the R process at some number of seconds in the future to e.g. interrupt a routine that is taking too long to complete. I can't find any R language support for this (e.g. a timeout argument to tryCatch() would be ideal), so am wondering what kinds of problems are to be expected
2010 May 30
1
Location of source code for readline()
...want to find the actual code to see if I can patch it, though I am a real novice in C. Suggestions welcome. My application, FYI, is to have a script that will display something, and wait for a keypress (for readline it seems to need the Enter key) but timeout after a preset number of seconds. The setTimeLimit "almost" works -- but not for readline. I'm thinking of a modified readline like readline(prompt='Do you want to continue?', timeout=6). Note that the issue seems to be Windows. I haven't a Mac to try, but Linux can be made to function by various methods at the top. Sigh...
2012 Dec 13
4
Running MCMC in R
Dear all I am now running a MCMC iteration in the R program. But it is always stucked in some loop. This cause big problems for my research. So I want to know whether we can skip the current dataset and move to next simulated data when the iteration is stucked? Alternatively, can the MCMC chain skip the current iteration when it is stucked and automatically to start another chain with different
2019 May 03
1
Strange error messages from parallel::mcparallel family under 3.6.0
...ng something wrong all this time and R 3.6.0 has exposed it, or whether something else is going on. # Background # Ultimately, what I want to do is to be able to set a time limit for an expression to be evaluated that would be enforced even inside compiled code. (R.utils::withTimeout() uses base::setTimeLimit(), which can only enforce within R code.) # Implementation # The approach that my implementation, statnet.common::forkTimeout() (source attached for convenience), uses is to call mcparallel() to evaluate the expression in a child process, then mccollect() with wait=FALSE and a timeout to give it...
2010 Dec 07
2
Time out for a R Function
Hello Group, I have an R-function that works fine for most part but sometime runs into a long loop! (I'm lazy and short on time to debug right now so want to do something easy) For my purpose, it is ok to make few errors .... is there a way I can put a timeout on a function and the r-process needes to move on to the next step? Thank you. S
2008 Jun 16
1
Execute expr with a timeout?
Hello, Does someone know how to execute an expression in R, limiting the time to evaluate it and raising an exception if it takes too long to run? Something like: > with.timeout(expr, timeout = 10) which stops the evaluation of 'expr' if it is not done after 10 sec? Best, Philippe Grosjean