snowFT-rand              package:snowFT              R Documentation

_R_a_n_d_o_m _N_u_m_b_e_r _G_e_n_e_r_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Initialize independent random number streams to be used in the
     cluster. It uses either the L'Ecuyer's random number generator
     (package rlecuyer required) or the SPRNG generator (package rsprng
     required).

_U_s_a_g_e:

     clusterSetupRNG.FT (cl, type = "RNGstream", streamper="replicate", ...)
     clusterSetupRNGstreamRepli (cl, seed=rep(12345,6), n, ...)

_A_r_g_u_m_e_n_t_s:

      cl: Cluster object.

    type: 'type="RNGstream"' (default) initializes the L'Ecuyer's RNG. 
          'type="SPRNG"' initializes the SPRNG generator.

streamper: 'streamper="node"' initializes one random number stream per
          node.
           'streamper="replicate"' (default) initializes one stream per
          replicate.

     ...: Arguments passed to the underlying function (see details
          bellow).

    seed: Integer value (SPRNG) or a vector of six integer values
          (RNGstream) used as seed for the RNG.

       n: Number of streams to be created. It should correspond to the
          number of replicates in the computation.

_D_e_t_a_i_l_s:

     'clusterSetupRNG.FT' calls (subject to its argument values) one of
     the following functions, passing arguments '(cl, ...)': If the
     "SPRNG" type is used, then in case of 'streamper="node"' the snow
     function 'clusterSetupSPRNG' is called. In case of
     'streamper="replicate"', the function only checks the availability
     of the 'rsprng' package on nodes but no initialization will be
     done at this point.  If the "RNGstream" type is used, then in case
     of 'streamper="node"' the snow function 'clusterSetupRNGstream' is
     called and in case of 'streamper="replicate"' the function
     'clusterSetupRNGstreamRepli' is called. In the latter case, the
     argument 'n' has to be given that corresponds to the total number
     of streams created for the computation. This mode is used by
     'clusterApplyFT'.  Note that using the function 'performParalell',
      the user does not need to initialize the RNG separately, since it
     is accomplished within the function. 

     'clusterSetupRNGstreamRepli' loads the 'rlecuyer' package and on
     each node it creates 'n' streams. The streams are named by their
     ordinal number.

_E_x_a_m_p_l_e_s:

       ## Not run: 
     cl <- makeClusterFT(3)
     r<-10
     clusterSetupRNG.FT(cl, type="RNGstream", streamper="replicate",n=r, seed=rep(1,6))
     res<-clusterApplyFT(cl,rep(5,10),rnorm,gentype="RNGstream")
     stopCluster(res[[2]])
     print(res[[1]])
       
     ## End(Not run)

