Displaying 20 results from an estimated 10000 matches similar to: "best practice for packages using mclapply to avoid tcltk"
2012 Dec 31
3
weird bug with parallel, RSQlite and tcltk
Hello,
I spent a lot of a time on a weird bug, and I just managed to narrow it down.
In parallel code (here with parallel::mclappy, but I got it
doMC/multicore too), if the library(tcltk) is loaded, R hangs when
trying to open a DB connection.
I got the same behaviour on two different computers, one dual-core,
and one 2 xeon quad-core.
Here's the code:
library(parallel)
library(RSQLite)
2012 Aug 30
1
tcltk capability
There are quite a few packages that make use of tcltk and although
- most R distributions have tcltk capability
- its possible to query this via capabilities()[["tcltk"]]
- attempting to build a package that needs it on such an R
distribution will give a message letting one know
users still seem to have problems with this.
There was recently an R bug report submitted that likely
2012 Dec 11
1
Bug in mclapply?
I've been using mclapply and have encountered situations where it gives
errors or returns incorrect results. Here's a minimal example, which gives
the error on R 2.15.2 on Mac and Linux:
library(parallel)
f <- function(x) NULL
mclapply(1, f, mc.preschedule = FALSE, mc.cores = 1)
# Error in sum(sapply(res, inherits, "try-error")) :
# invalid 'type' (list) of argument
2015 Jul 24
1
Memory limitations for parallel::mclapply
Hello,
I have been having issues using parallel::mclapply in a memory-efficient
way and would like some guidance. I am using a 40 core machine with 96 GB
of RAM. I've tried to run mclapply with 20, 30, and 40 mc.cores and it has
practically brought the machine to a standstill each time to the point
where I do a hard reset.
When running mclapply with 10 mc.cores, I can see that each process
2023 May 16
1
mclapply enters into an infinite loop....
Dear members,
I am using arfima in an mclapply construction (from the parallel package):
Browse[2]> LYG <- mclapply(LYGH, FUN = arfima, mc.cores = detectCores())
^C
Browse[2]> LYG <- mclapply(LYGH[1:10], FUN = arfima, mc.cores = detectCores())
^C
Browse[2]> LYG <- mclapply(LYGH[1:2], FUN = arfima, mc.cores = detectCores())
^C
You can see that I am
2012 Dec 13
1
possible bug in function 'mclapply' of package parallel
Dear parallel users and developers,
I might have encountered a bug in the function 'mclapply' of package
'parallel'. I construct a matrix using the same input data and code with a
single difference: Once I use mclapply and the other time lapply.
Shockingly the result is NOT the same.
To evaluate please unpack the attached archive and execute
Rscript mclapply_test.R
I put the
2023 May 17
1
mclapply enters into an infinite loop....
Dear Jeff,
There was a problem in LYGH and lapply threw an error, but mclapply got stuck in an infinite loop. The doc for mclapply says that mclapply runs under try() with silent = TRUE. So that means mclapply should run properly, i.e output a try class object and exit. But it didn't. Can you shed some light on why this happened?
THanking you,
Yours sincerely,
AKSHAY M
2011 Mar 22
2
Problem with mclapply -- losing output/data
Hello,
I am running large simulations, which unfortunately I can't really
replicate here because the code is so extensive. I rely heavily on
mclapply, but I realize that I'm losing data somewhere.
There are two worrisome symptoms:
1) I am getting 'NULL' as a return value for some (but not all) elements
of the output when I use mclapply, but not if I use lapply
> tmp2[1:3]
2013 Apr 11
1
parallel::mclapply does not return try-error objects with mc.preschedule=TRUE
Hello,
Consider this:
1)
library(parallel)
res <- mclapply(1:2, stop)
#Warning message:
#In mclapply(1:2, stop) :
# all scheduled cores encountered errors in user code
is(res[[1]], 'try-error')
#[1] FALSE
2)
library(parallel)
res <- mclapply(1:2, stop, mc.preschedule=FALSE)
#Warning message:
#In mclapply(1:2, stop, mc.preschedule = FALSE) :
# 2 function calls resulted in an
2023 May 18
1
mclapply enters into an infinite loop....
On Wed, 17 May 2023 13:55:59 +0000
akshay kulkarni <akshay_e4 at hotmail.com> wrote:
> So that means mclapply should run properly, i.e output a try class
> object and exit. But it didn't. Can you shed some light on why this
> happened?
What's your sessionInfo()? Are you using a GUI frontend?
mclapply() relies on the fork() system call, which is tricky to get
right in a
2013 Nov 11
2
problem using rJava with parallel::mclapply
Dear all,
I got an issue trying to parse excel files in parallel using XLConnect, the
process hangs forever.
Martin Studer, the maintainer of XLConnect kindly investigated the issue,
identified rJava as a possible cause of the problem:
This does not work (hangs):
library(parallel)
require(rJava)
.jinit()
res <- mclapply(1:2, function(i) {
2020 Apr 28
2
mclapply returns NULLs on MacOS when running GAM
Dear R-devel,
I am experiencing issues with running GAM models using mclapply, it fails to return any values if the data input becomes large. For example here the code runs fine with a df of 100 rows, but fails at 1000.
library(mgcv)
library(parallel)
> df <- data.frame(
+ x = 1:100,
+ y = 1:100
+ )
>
> mclapply(1:2, function(i, df) {
+ fit <- gam(y ~ s(x, bs =
2012 Dec 29
1
parallel error message extraction (in mclapply)?
dear R experts---I am looking at a fairly uninformative error in my program:
Error in mclapply(1:nrow(opts), solveme) :
(converted from warning) all scheduled cores encountered errors in user code
the doc on ?mclapply tells me that
In addition, each process is running the job inside try(...,
silent=TRUE) so if error occur they will be stored as try-error
objects in the list.
I looked up
2019 Apr 13
3
SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()
Hi Inaki,
> "Performant"... in terms of what. If the cost of copying the data
> predominates over the computation time, maybe you didn't need
> parallelization in the first place.
Performant in terms of speed. There's no copying in that example
using `mclapply` and so it is significantly faster than other
alternatives.
It is a very simple and contrived example, but
2019 Apr 11
2
SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()
ISSUE:
Using *forks* for parallel processing in R is not always safe. The
`parallel::mclapply()` function uses forked processes to parallelize.
One example where it has been confirmed that forked processing causes
problems is when running R via RStudio. It is recommended to use
PSOCK clusters (`parallel::makeCluster()`) rather than *forked*
processes when running R from RStudio (
2018 Jul 26
2
Random behavior of mclapply
Hi,
I wondered about the behavior described in the following stackoverflow
question:
https://stackoverflow.com/questions/20674538/mclapply-returns-null-randomly
More specifically, I would like to know if you ever considered the
suggestion made in the comments of the first answer, namely to somehow warn
the user if one of the processes has been killed by the out-of-memory
killer ?
I am always
2020 Apr 28
2
mclapply returns NULLs on MacOS when running GAM
Yes I am running on Rstudio 1.2.5033. I was also running this code without error on Ubuntu in Rstudio. Checking again on the terminal and it does indeed work fine even with large data.frames.
Any idea as to what interaction between Rstudio and mclapply causes this?
Thanks,
Shian
On 28 Apr 2020, at 7:29 pm, Simon Urbanek <simon.urbanek at R-project.org<mailto:simon.urbanek at
2014 Mar 27
2
mclapply Segmentation Fault for Ubuntu
Running the example in the documentation causes R to crash.
dario at bioinfo:~$ R
R version 3.0.3 (2014-03-06) -- "Warm Puppy"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or
2011 Apr 11
1
Mclapply and print statement
Dear all.
I am using the mclapply function to split my code to the many cores my system has. It seems that is working fine. This is the parallel version of lcapply.
The only problem that I seem to have is that the printf cannot print messages.
The ideal to me is to have fro my function an output of the form
Shadowlist<-mclapply(1:dimz, function(i) {
print(sprintf('Creating the
2020 Oct 08
2
exiting mclapply early on error
Hey folks,
Is there any way to exit an mclapply early on error?
For example, in the following mclapply loop, I have to wait for all the processes to finish before the error is returned.
```
mclapply(X = 1:12, FUN = function(x) {Sys.sleep(0.1); if(x == 4) stop()}, mc.cores = 4, mc.preschedule = F)
```
When there are many calculations in FUN, it takes a long time before the error is returned.