Skip to content

Commit 3cc2168

Browse files
Remove spaces from the system() calls to avoid ~+~ for each space in the 'ps' and commandArgs() output for parallel workers
1 parent 4b71008 commit 3cc2168

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: parallelly
2-
Version: 1.42.0-9003
2+
Version: 1.42.0-9004
33
Title: Enhancing the 'parallel' Package
44
Imports:
55
parallel,

R/makeNodePSOCK.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ makeNodePSOCK <- function(worker = getOption2("parallelly.localhost.hostname", "
764764
}
765765

766766
if (length(socketOptions) == 1L) {
767-
code <- sprintf("options(socketOptions = \"%s\")", socketOptions)
767+
code <- sprintf("options(socketOptions=\"%s\")", socketOptions)
768768
rscript_expr <- c("-e", shQuote(code, type = rscript_sh[1]))
769769
rscript_args_internal <- c(rscript_args_internal, rscript_expr)
770770
}
@@ -830,7 +830,7 @@ makeNodePSOCK <- function(worker = getOption2("parallelly.localhost.hostname", "
830830
tryCatch({
831831
parse(text = code)
832832
}, error = function(ex) {
833-
stopf("Argument 'rscript_envs' appears to contain invalid values: %s", paste(sprintf("%s=%s", sQuote(names), sQuote(rscript_envs)), collapse = ", "))
833+
stopf("Argument 'rscript_envs' appears to contain invalid values: %s", paste(sprintf("%s=%s", sQuote(names), sQuote(rscript_envs)), collapse = ","))
834834
})
835835
rscript_args_internal <- c(rscript_args_internal, "-e", shQuote(code, type = rscript_sh[1]))
836836
}
@@ -854,7 +854,7 @@ makeNodePSOCK <- function(worker = getOption2("parallelly.localhost.hostname", "
854854
## .{slave,work}RSOCK() command already specified?
855855
if (!any(grepl("parallel:::[.](slave|work)RSOCK[(][)]", rscript_args))) {
856856
## In R (>= 4.1.0), parallel:::.slaveRSOCK() was renamed to .workRSOCK()
857-
cmd <- "workRSOCK <- tryCatch(parallel:::.workRSOCK, error=function(e) parallel:::.slaveRSOCK); workRSOCK()"
857+
cmd <- "workRSOCK<-tryCatch(parallel:::.workRSOCK,error=function(e)parallel:::.slaveRSOCK);workRSOCK()"
858858
rscript_args_internal <- c(rscript_args_internal, "-e", shQuote(cmd, type = rscript_sh[1]))
859859
}
860860

R/utils,cluster.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ useWorkerPID <- local({
274274
pidfile <- tempfile(pattern = sprintf("worker.rank=%d.parallelly.parent=%d.",
275275
rank, parent_pid), fileext = ".pid")
276276
pidfile <- normalizePath(pidfile, winslash = "/", mustWork = FALSE)
277-
pidcode <- sprintf('try(suppressWarnings(cat(Sys.getpid(),file="%s")), silent = TRUE)', pidfile)
277+
pidcode <- sprintf('try(suppressWarnings(cat(Sys.getpid(),file="%s")),silent=TRUE)', pidfile)
278278
rscript_pid_args <- c("-e", shQuote(pidcode, type = rscript_sh))
279279
list(pidfile = pidfile, rscript_pid_args = rscript_pid_args)
280280
}

0 commit comments

Comments
 (0)