similar to: Foreach %dopar% operator incorrectly load balancing

Displaying 20 results from an estimated 200 matches similar to: "Foreach %dopar% operator incorrectly load balancing"

2010 Apr 29
2
dopar parallel assignments
Hi guys, I was wondering why this piece of code doesn't work: foreach (i = c(1.25,1.50)) %dopar% { assign(paste("test_",i,sep=""),i) } but, this does: foreach (i = c(1.25,1.50)) %do% { assign(paste("test_",i,sep=""),i) } Obviously, the difference is %dopar% vs. %do%. If I use %do%, I get objects test_1.25 and test_1.50, but I don't get these
2011 May 27
0
object not found with %dopar% when using foreach
Dear R-List member, tried implement the foreach loop. It works fine, when I'm using %do%, but not when I'm using %dopar%. I always receive one of the following error messages: error in { : task 1 failed - "Objekt 'S3' not found" - could the .export be an solution for this?? Any help is much appreciated! The Code hast the following structure: ########## dft3 =
2018 Mar 10
0
. Package gamlss used inside foreach() and %dopar% fails to find an object (Nik Tuzov)
Dear Nik Try the following code loo_predict.mu <- function(model.obj, input.data) { yhat <- foreach(i = 1 : nrow(input.data), .packages="gamlss", .combine = rbind) %dopar% { updated.model.obj <- update(model.obj, data = input.data[-i, ]) predict(updated.model.obj, what = "mu", data = input.data[-i, ], newdata = input.data[i,], type =
2018 Mar 12
0
Package gamlss used inside foreach() and %dopar% fails to find an object
Hello Mikis: Thanks a lot, it worked. Could you tell me what the problem was? Regards, Nik ----- Original Message ----- From: r-help-request at r-project.org To: "r-help" Sent: Sunday, March 11, 2018 6:00:02 AM Subject: R-help Digest, Vol 181, Issue 11 Send R-help mailing list submissions to r-help at r-project.org To subscribe or unsubscribe via the World Wide Web, visit
2018 Mar 09
0
Package gamlss used inside foreach() and %dopar% fails to find an object
If the code you are running in parallel is complicated, maybe foreach is not sophisticated enough to find all the variables you refer to. Maybe use parallel::clusterExport yourself? But be a aware that passing parameters is much safer than directly accessing globals in parallel processing, so this might just be your warning to not do that anyway. -- Sent from my phone. Please excuse my brevity.
2018 Mar 09
2
Package gamlss used inside foreach() and %dopar% fails to find an object
Hello all: Please help me with this "can't find object" issue. I'm trying to get leave-one-out predicted values for Beta-binomial regression. It may be the gamlss issue because the code seems to work when %do% is used. I have searched for similar issues, but haven't managed to figure it out. This is on Windows 10 platform. Thanks in advance, Nik #
2012 Feb 18
3
foreach %do% and %dopar%
Hi everyone, I'm working on a script trying to use foreach %dopar% but without success, so I manage to run the code with foreach %do% and looks like this: The code is part of a MCMC model for projects valuation, returning the most important results (VPN, TIR, EVA, etc.) of the simulation. foreach (simx = NsimT, .combine=cbind, .inorder=FALSE, .verbose=TRUE) %do% { MCPVMPA = MCVAMPA[simx]
2011 Jul 02
5
%dopar% parallel processing experiment
dear R experts--- I am experimenting with multicore processing, so far with pretty disappointing results. Here is my simple example: A <- 100000 randvalues <- abs(rnorm(A)) minfn <- function( x, i ) { log(abs(x))+x^3+i/A+randvalues[i] } ?## an arbitrary function ARGV <- commandArgs(trailingOnly=TRUE) if (ARGV[1] == "do-onecore") { ?library(foreach) ?discard <-
2019 Feb 01
2
Set the number of threads using openmp with .Fortran?
Hi everybody, I'm trying to develop an R package with Fortran and OpenMP. I wrote a simple hello world but I'm not able to set the number of threads. I found this old email chain <http://r.789695.n4.nabble.com/Set-the-number-of-threads-using-openmp-with-C-td2284685.html> and I tried to set my compile instructions accordingly but i had no luck. *This is my makevars:*
2019 Feb 02
1
Set the number of threads using openmp with .Fortran?
I got this to work on Linux but it is not working on Windows. *My understanding is that this should also work on windows, is that correct?* If so, what should I do? differently? To get it to work on Linux, I modified my R script as follows: #' OpenMP Hello World #' #' @param nthreads The number of threads that you want to use #' @example #' hello(nthreads=2) #' @export
2019 Feb 02
0
Set the number of threads using openmp with .Fortran?
I was able to make some progress by using this <https://github.com/bert9bert/ParallelForest/blob/master/src/Makevars> as a reference. Now: *This is my makevars:* ##### Compiler flags ##### PKG_FCFLAGS = $(SHLIB_OPENMP_FFLAGS) PKG_LIBS = $(SHLIB_OPENMP_CFLAGS) ##### Phony target for R's build system to invoke ##### all: $(SHLIB) ##### Clean target ##### clean: rm -f *.o *.mod
2012 Mar 01
2
'break' function in loop
Dear R helpers, I have some difficulties in using ''break'' function with loop, and the followings are my script. What I try to do is (1) permute ''or'' first; (2) doing t-test if this ''or'' pass criteria 1 (k=1); (3) end the loop when I get 10 permutations; (4) redo everything again but this time use criteria 2 (k=2) (I have more criteria 1:n).
2011 Feb 09
1
Iterate over a list of input files?
Hi, I've got the following code which seems to work fine for a single file if I specify the file name explicitly in the code. What I need to do is run it on all the files in the directory tested and augment the data frame I'm building to have more results columns.How can I do that? Here's the code: library(chron) # .Holidays / is.holiday / is.weekend TStoDate = function
2013 Oct 15
1
Problem with lapply
Hi together I'm pretty new to R, so excuse me if it is a basic question. I have a big dataset (extract of it found in the attachment) of returns from firms. I'd like to compute the Pearson correlation of each firm with the "Market" and the corresponding p-Value. So I thought of making a list of 'cor.test's and then extract the needed values with a for loop. What I did so
2012 Feb 08
1
How indices calculated in package "boot"
Hi,there, I am using R package "boot" to bootstrap. I have one question here: does anybody possibly know how the boot package generates the "indices" which is used in the statistic function? I thought "indices = sample(data, replace=TRUE)", but when I replaced "indices" with this command and used "boot", I got different results. Specifically,
2014 Apr 18
2
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
On Fri, Apr 18, 2014 at 11:13 AM, Dmitry Vyukov <dvyukov at google.com> wrote: > Hi, > > This is long thread, so I will combine several comments into single email. > > > >> - 8-bit per-thread counters, dumping into central counters on overflow. > >The overflow will happen very quickly with 8bit counter. > > Yes, but it reduces contention by 256x (a thread
2014 Apr 18
4
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
On Apr 17, 2014, at 2:04 PM, Chandler Carruth <chandlerc at google.com> wrote: > On Thu, Apr 17, 2014 at 1:27 PM, Justin Bogner <mail at justinbogner.com> wrote: > Chandler Carruth <chandlerc at google.com> writes: > > if (thread-ID != main's thread-ID && shard_count < std::min(MAX, NUMBER_OF_CORES)) { > > shard_count = std::min(MAX,
2007 May 14
2
creating a "list of 3 dataframes" from a "list of 2 dataframes" and a dataframe?
#I wish to create a "list of three dataframes" ("results2") from a "list of two dataframes" (temp) and a dataframe ("c")? #Please advise. a <- data.frame(x=c(1,2,3),y=c(5,7,9)) b <- data.frame(x=c(2,4,7,9),y=c(2,3,5,4)) c <- data.frame(x=c(22,34,7,9),y=c(52,63,5,4)) results1 <- list(a,b,c) #what I want #but this is how I need to get there
2014 Apr 18
2
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
On Fri, Apr 18, 2014 at 11:44 AM, Dmitry Vyukov <dvyukov at google.com> wrote: > On Fri, Apr 18, 2014 at 11:32 AM, Dmitry Vyukov <dvyukov at google.com>wrote: > >> On Fri, Apr 18, 2014 at 11:13 AM, Dmitry Vyukov <dvyukov at google.com>wrote: >> >>> Hi, >>> >>> This is long thread, so I will combine several comments into single
2011 Jul 12
2
foreach not recognizing functions in memory
All, I am not understanding the scoping used in foreach when it is used inside a function. I keep getting "could not find function" errors for functions that are in memory when I try to use foreach within a function call. I have a simple example below. "testFun" is in memory and works when called by foreach directly, but when I place foreach in a function called