View | Details | Raw Unified | Return to bug 16668
Collapse All | Expand All

(-)src/library/parallel/R/RngStream.R (-2 / +2 lines)
Lines 62-68 Link Here
62
mc.reset.stream <- function() {
62
mc.reset.stream <- function() {
63
    if (RNGkind()[1L] == "L'Ecuyer-CMRG") {
63
    if (RNGkind()[1L] == "L'Ecuyer-CMRG") {
64
        if (!exists(".Random.seed", envir = .GlobalEnv, inherits = FALSE))
64
        if (!exists(".Random.seed", envir = .GlobalEnv, inherits = FALSE))
65
            stats::runif(1)
65
            sample.int(1L)
66
        assign("LEcuyer.seed",
66
        assign("LEcuyer.seed",
67
               get(".Random.seed", envir = .GlobalEnv, inherits = FALSE),
67
               get(".Random.seed", envir = .GlobalEnv, inherits = FALSE),
68
               envir = RNGenv)
68
               envir = RNGenv)
Lines 76-82 Link Here
76
        if (reset ||
76
        if (reset ||
77
            !exists("LEcuyer.seed", envir = RNGenv, inherits = FALSE)) {
77
            !exists("LEcuyer.seed", envir = RNGenv, inherits = FALSE)) {
78
            if (!exists(".Random.seed", envir = .GlobalEnv, inherits = FALSE))
78
            if (!exists(".Random.seed", envir = .GlobalEnv, inherits = FALSE))
79
                stats::runif(1)
79
                sample.int(1L)
80
            assign("LEcuyer.seed",
80
            assign("LEcuyer.seed",
81
                   get(".Random.seed", envir = .GlobalEnv, inherits = FALSE),
81
                   get(".Random.seed", envir = .GlobalEnv, inherits = FALSE),
82
                   envir = RNGenv)
82
                   envir = RNGenv)
(-)src/library/parallel/R/snow.R (-1 / +1 lines)
Lines 85-91 Link Here
85
    port <- Sys.getenv("R_PARALLEL_PORT")
85
    port <- Sys.getenv("R_PARALLEL_PORT")
86
    port <- if (identical(port, "random")) NA else as.integer(port)
86
    port <- if (identical(port, "random")) NA else as.integer(port)
87
    if (is.na(port))
87
    if (is.na(port))
88
        port <- 11000 + 1000 * ((stats::runif(1L) + unclass(Sys.time())/300) %% 1)
88
        port <- 11000 + 1000 * ((sample.int(1000, size=1)/1000 + unclass(Sys.time())/300) %% 1)
89
    Sys.i <- Sys.info()
89
    Sys.i <- Sys.info()
90
    options <- list(port = as.integer(port),
90
    options <- list(port = as.integer(port),
91
                    timeout = 60 * 60 * 24 * 30, # 30 days
91
                    timeout = 60 * 60 * 24 * 30, # 30 days

Return to bug 16668