Hi there,

I have some question about how to use this package:

My code structure is as follows:

rm(list=ls())
set.seed(2014)
library(snowfall)

#############
#part 1:

generate the initial value for simulation

#part 2:
some functions will be used in the simulation

#simulation part, start from "while loop"

sink('SnowFallExample.Rout', split=TRUE)
.Platform
.Machine
R.version
Sys.info()

sfInit(parallel=TRUE,cpus=4,type="SOCK")

simu<-1
while(simu<=1000){
functions.....

}

Then I used the above structure with sflnit to do the simulation, I found that there is no change on the time for simulation, even worse, sometime, the code with "sflnit" is slower than the code without sflnit. So any suggestions?

Another problem is that when I use library(snowfall) , even though I have set the seed with "2014", but the values I generated are different from the code without library(snowfall).

Do anybody have any idea to how to use this package to speed up the simulation? I really appreciate your help.

Have a nice day



Sincerely,
Yinding Wang


	[[alternative HTML version deleted]]

