From 2e498394a2d1ac813b381e6aa8480a97eea3983f Mon Sep 17 00:00:00 2001 From: junikimm717 Date: Wed, 25 Aug 2021 20:54:10 -0400 Subject: [PATCH] Fixed windows mclapply bug --- README.md | 5 +++++ src/script.def.R | 3 +++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 80bc8ec..badcd54 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,8 @@ isotopes to be searched for. If `verbose.enable` is set to `TRUE`, files of the form `(fragment number).txt` containing the `pattern.search` output will be printed to the directory specified in `verbose.outputdir`, assuming the directory already exists. + +## Additional Notes + +As windows does not allow forking, the number of cores used on it will be +constrained to 1. diff --git a/src/script.def.R b/src/script.def.R index d3bd75a..50b043f 100644 --- a/src/script.def.R +++ b/src/script.def.R @@ -79,6 +79,9 @@ fragments <- max(table[, columns.spectra]) # set use_cores to safe amount use_cores = min(use_cores, detectCores() - 1) +if (.Platform$OS.type == "windows") { + use_cores=1L +} # lower bound of indices per fragment # (sorting guarantees that data points of same fragment are together)