[R] Get identical results for parallel and sequential?

2012-02-11 Thread slbfelix
Hi All, 

I have a question about R parallel computing by using snowfall. 

How can I set the seeds on parallel workers to get the same result as
sequential mode? 

For example: 

> sfSapply(c(1,1),rnorm) 
[1]  1.823082 -2.222052 
> rnorm(2) 
[1] -0.5179967 -1.0807196 

How to get the identical result? 

Thanks. 
Libo

--
View this message in context: 
http://r.789695.n4.nabble.com/Get-identical-results-for-parallel-and-sequential-tp4380110p4380110.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R Parallel question

2012-02-11 Thread slbfelix
Hi All,

I have a question about R parallel computing by using snowfall.

How can I set the seeds on parallel workers to get the same result as
sequential mode?

For example:

> sfSapply(c(1,1),rnorm)
[1]  1.823082 -2.222052
> rnorm(2)
[1] -0.5179967 -1.0807196

How to get the identical result?

Thanks.
Libo Sun

Graduate Student,
Department of Statistics,
Colorado State University
Fort Collins, CO


--
View this message in context: 
http://r.789695.n4.nabble.com/R-Parallel-question-tp4380098p4380098.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Get identical results for parallel and sequential?

2012-02-12 Thread slbfelix
Sorry. That was my first time to post, I was not sure if it worked or not.

Libo

--
View this message in context: 
http://r.789695.n4.nabble.com/Get-identical-results-for-parallel-and-sequential-tp4380110p4381648.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.