diff --git a/DESCRIPTION b/DESCRIPTION index 336fc99..ebdacdc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: Strategus Type: Package Title: Coordinate and Execute OHDSI HADES Modules -Version: 1.1.1 -Date: 2024-12-03 +Version: 1.1.2 +Date: 2024-12-04 Authors@R: c( person("Anthony", "Sena", email = "sena@ohdsi.org", role = c("aut", "cre")), person("Martijn", "Schuemie", email = "schuemie@ohdsi.org", role = c("aut")), diff --git a/NEWS.md b/NEWS.md index 4ff1482..1e30d53 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +Strategus 1.1.2 +=============== +- Add options for overriding number of threads for database operations (#190) + Strategus 1.1.1 =============== - Fixes R CMD note and updates documentation for inclusion into HADES diff --git a/R/Module-CohortMethod.R b/R/Module-CohortMethod.R index 619fc2c..f6521b5 100644 --- a/R/Module-CohortMethod.R +++ b/R/Module-CohortMethod.R @@ -23,6 +23,14 @@ CohortMethodModule <- R6::R6Class( jobContext <- private$jobContext multiThreadingSettings <- CohortMethod::createDefaultMultiThreadingSettings(jobContext$moduleExecutionSettings$maxCores) + # Provide hook to allow for overriding the number of threads + # used for database operations + getDbCohortMethodDataThreads <- as.integer(getOption("strategus.CohortMethodModule.getDbCohortMethodDataThreads")) + if (isTRUE(getDbCohortMethodDataThreads > 0)) { + private$.message(paste0("Detected strategus.CohortMethodModule.getDbCohortMethodDataThreads - setting value to: ", getDbCohortMethodDataThreads)) + multiThreadingSettings$getDbCohortMethodDataThreads <- getDbCohortMethodDataThreads + } + args <- jobContext$settings args$connectionDetails <- connectionDetails args$cdmDatabaseSchema <- jobContext$moduleExecutionSettings$cdmDatabaseSchema diff --git a/R/Module-SelfControlledCaseSeries.R b/R/Module-SelfControlledCaseSeries.R index a5b5377..fda82d3 100644 --- a/R/Module-SelfControlledCaseSeries.R +++ b/R/Module-SelfControlledCaseSeries.R @@ -25,6 +25,14 @@ SelfControlledCaseSeriesModule <- R6::R6Class( jobContext <- private$jobContext sccsMultiThreadingSettings <- SelfControlledCaseSeries::createDefaultSccsMultiThreadingSettings(jobContext$moduleExecutionSettings$maxCores) + # Provide hook to allow for overriding the number of threads + # used for database operations + getDbSccsDataThreads <- as.integer(getOption("strategus.SelfControlledCaseSeriesModule.getDbSccsDataThreads")) + if (isTRUE(getDbSccsDataThreads > 0)) { + private$.message(paste0("Detected strategus.SelfControlledCaseSeriesModule.getDbSccsDataThreads - setting value to: ", getDbSccsDataThreads)) + sccsMultiThreadingSettings$getDbSccsDataThreads <- getDbSccsDataThreads + } + args <- jobContext$settings args$connectionDetails <- connectionDetails args$cdmDatabaseSchema <- jobContext$moduleExecutionSettings$cdmDatabaseSchema diff --git a/extras/Strategus.pdf b/extras/Strategus.pdf index 654cbd4..dff6ff9 100644 Binary files a/extras/Strategus.pdf and b/extras/Strategus.pdf differ diff --git a/inst/doc/CreatingAnalysisSpecification.pdf b/inst/doc/CreatingAnalysisSpecification.pdf index 631f01f..b954689 100644 Binary files a/inst/doc/CreatingAnalysisSpecification.pdf and b/inst/doc/CreatingAnalysisSpecification.pdf differ diff --git a/inst/doc/ExecuteStrategus.pdf b/inst/doc/ExecuteStrategus.pdf index 67dcbcd..ead4635 100644 Binary files a/inst/doc/ExecuteStrategus.pdf and b/inst/doc/ExecuteStrategus.pdf differ diff --git a/inst/doc/IntroductionToStrategus.pdf b/inst/doc/IntroductionToStrategus.pdf index 61c406b..c70751d 100644 Binary files a/inst/doc/IntroductionToStrategus.pdf and b/inst/doc/IntroductionToStrategus.pdf differ diff --git a/inst/doc/WorkingWithResults.pdf b/inst/doc/WorkingWithResults.pdf index a25b1b1..64044ff 100644 Binary files a/inst/doc/WorkingWithResults.pdf and b/inst/doc/WorkingWithResults.pdf differ